mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
Imrpove the intersection speed in the words criterion
This commit is contained in:
parent
ef381e17bb
commit
3415812b06
@ -129,10 +129,15 @@ fn resolve_candidates<'t>(
|
|||||||
|
|
||||||
match query_tree {
|
match query_tree {
|
||||||
And(ops) => {
|
And(ops) => {
|
||||||
|
let mut ops = ops.iter().map(|op| {
|
||||||
|
resolve_operation(ctx, op, cache)
|
||||||
|
}).collect::<anyhow::Result<Vec<_>>>()?;
|
||||||
|
|
||||||
|
ops.sort_unstable_by_key(|cds| cds.len());
|
||||||
|
|
||||||
let mut candidates = RoaringBitmap::new();
|
let mut candidates = RoaringBitmap::new();
|
||||||
let mut first_loop = true;
|
let mut first_loop = true;
|
||||||
for op in ops {
|
for docids in ops {
|
||||||
let docids = resolve_operation(ctx, op, cache)?;
|
|
||||||
if first_loop {
|
if first_loop {
|
||||||
candidates = docids;
|
candidates = docids;
|
||||||
first_loop = false;
|
first_loop = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user