mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-11 14:04:31 +01: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 => {
|
None => {
|
||||||
match self.index.main.sorted_document_ids_cache(reader)? {
|
match self.index.main.sorted_document_ids_cache(reader)? {
|
||||||
// build result from cached document ids
|
// 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)? {
|
if let Some(f) = self.facet_count_docids(reader)? {
|
||||||
sort_result.exhaustive_facets_count = Some(true);
|
sort_result.exhaustive_facets_count = Some(true);
|
||||||
// document ids are not sorted in natural order, we need to construct a new set
|
// 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 fst::{IntoStreamer, Streamer};
|
||||||
use itertools::{EitherOrBoth, merge_join_by};
|
use itertools::{EitherOrBoth, merge_join_by};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use meilisearch_tokenizer::Token;
|
|
||||||
use meilisearch_tokenizer::analyzer::{Analyzer, AnalyzerConfig};
|
use meilisearch_tokenizer::analyzer::{Analyzer, AnalyzerConfig};
|
||||||
use sdset::{Set, SetBuf, SetOperation};
|
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)> {
|
fn split_query_string<'a, A: AsRef<[u8]>>(s: &str, stop_words: &'a fst::Set<A>) -> Vec<(usize, String)> {
|
||||||
// TODO: Use global instance instead
|
// TODO: Use global instance instead
|
||||||
let analyzer = Analyzer::new(AnalyzerConfig::default_with_stopwords(stop_words));
|
Analyzer::new(AnalyzerConfig::default_with_stopwords(stop_words))
|
||||||
analyzer
|
|
||||||
.analyze(s)
|
.analyze(s)
|
||||||
.tokens()
|
.tokens()
|
||||||
.filter(|t| t.is_word())
|
.filter(|t| t.is_word())
|
||||||
.map(| Token { word, .. }| word.to_string())
|
.map(|t| t.word.to_string())
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn index_text(&mut self, id: DocumentId, indexed_pos: IndexedPos, text: &str) -> usize {
|
pub fn index_text(&mut self, id: DocumentId, indexed_pos: IndexedPos, text: &str) -> usize {
|
||||||
let mut number_of_words = 0;
|
let mut number_of_words = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user