mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 03:55:07 +08:00
fix style
This commit is contained in:
parent
398577f116
commit
808be4678a
@ -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
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user