mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
Use the words criterion in the search module
This commit is contained in:
parent
1e47f9b3ff
commit
e174ccbd8e
@ -70,7 +70,7 @@ impl<'t> Criterion for Words<'t> {
|
|||||||
bucket_candidates,
|
bucket_candidates,
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
(Some(_qt), Forbidden(candidates)) => {
|
(Some(_qt), Forbidden(_candidates)) => {
|
||||||
todo!()
|
todo!()
|
||||||
},
|
},
|
||||||
(None, Allowed(_)) => {
|
(None, Allowed(_)) => {
|
||||||
|
@ -11,8 +11,8 @@ use once_cell::sync::Lazy;
|
|||||||
use roaring::bitmap::RoaringBitmap;
|
use roaring::bitmap::RoaringBitmap;
|
||||||
|
|
||||||
use crate::search::criteria::{Criterion, CriterionResult};
|
use crate::search::criteria::{Criterion, CriterionResult};
|
||||||
use crate::search::criteria::typo::Typo;
|
use crate::search::criteria::{typo::Typo, words::Words};
|
||||||
use crate::{Index, DocumentId};
|
use crate::{Index, FieldId, DocumentId};
|
||||||
|
|
||||||
pub use self::facet::{FacetCondition, FacetDistribution, FacetNumberOperator, FacetStringOperator};
|
pub use self::facet::{FacetCondition, FacetDistribution, FacetNumberOperator, FacetStringOperator};
|
||||||
pub use self::facet::{FacetIter};
|
pub use self::facet::{FacetIter};
|
||||||
@ -71,7 +71,7 @@ impl<'a> Search<'a> {
|
|||||||
let analyzer = Analyzer::new(AnalyzerConfig::default_with_stopwords(stop_words));
|
let analyzer = Analyzer::new(AnalyzerConfig::default_with_stopwords(stop_words));
|
||||||
let result = analyzer.analyze(query);
|
let result = analyzer.analyze(query);
|
||||||
let tokens = result.tokens();
|
let tokens = result.tokens();
|
||||||
builder.optional_words(false).build(tokens)
|
builder.build(tokens)
|
||||||
},
|
},
|
||||||
None => None,
|
None => None,
|
||||||
};
|
};
|
||||||
@ -89,7 +89,8 @@ impl<'a> Search<'a> {
|
|||||||
|
|
||||||
// We aretesting the typo criteria but there will be more of them soon.
|
// We aretesting the typo criteria but there will be more of them soon.
|
||||||
let criteria_ctx = criteria::HeedContext::new(self.rtxn, self.index)?;
|
let criteria_ctx = criteria::HeedContext::new(self.rtxn, self.index)?;
|
||||||
let mut criteria = Typo::initial(&criteria_ctx, query_tree, facet_candidates)?;
|
let typo_criterion = Typo::initial(&criteria_ctx, query_tree, facet_candidates)?;
|
||||||
|
let mut criteria = Words::new(&criteria_ctx, Box::new(typo_criterion))?;
|
||||||
|
|
||||||
let mut offset = self.offset;
|
let mut offset = self.offset;
|
||||||
let mut limit = self.limit;
|
let mut limit = self.limit;
|
||||||
|
Loading…
Reference in New Issue
Block a user