fix style

This commit is contained in:
mpostma 2020-12-08 16:03:05 +01:00 committed by many
parent 398577f116
commit 808be4678a
No known key found for this signature in database
GPG Key ID: 2CEF23B75189EACA
3 changed files with 5 additions and 6 deletions

View File

@ -185,7 +185,9 @@ impl<'c, 'f, 'd, 'i> QueryBuilder<'c, 'f, 'd, 'i> {
None => {
match self.index.main.sorted_document_ids_cache(reader)? {
// build result from cached document ids
Some(docids) => { let mut sort_result = self.sort_result_from_docids(&docids, range);
Some(docids) => {
let mut sort_result = self.sort_result_from_docids(&docids, range);
if let Some(f) = self.facet_count_docids(reader)? {
sort_result.exhaustive_facets_count = Some(true);
// document ids are not sorted in natural order, we need to construct a new set

View File

@ -8,7 +8,6 @@ use std::{cmp, fmt, iter::once};
use fst::{IntoStreamer, Streamer};
use itertools::{EitherOrBoth, merge_join_by};
use log::debug;
use meilisearch_tokenizer::Token;
use meilisearch_tokenizer::analyzer::{Analyzer, AnalyzerConfig};
use sdset::{Set, SetBuf, SetOperation};
@ -177,12 +176,11 @@ const MAX_NGRAM: usize = 3;
fn split_query_string<'a, A: AsRef<[u8]>>(s: &str, stop_words: &'a fst::Set<A>) -> Vec<(usize, String)> {
// TODO: Use global instance instead
let analyzer = Analyzer::new(AnalyzerConfig::default_with_stopwords(stop_words));
analyzer
Analyzer::new(AnalyzerConfig::default_with_stopwords(stop_words))
.analyze(s)
.tokens()
.filter(|t| t.is_word())
.map(| Token { word, .. }| word.to_string())
.map(|t| t.word.to_string())
.enumerate()
.collect()
}

View File

@ -43,7 +43,6 @@ where
}
}
pub fn index_text(&mut self, id: DocumentId, indexed_pos: IndexedPos, text: &str) -> usize {
let mut number_of_words = 0;