Skip to content

Commit 2ef2554

Browse files
fix error when running a scoring query with cache (#6025)
1 parent dd209a7 commit 2ef2554

File tree

1 file changed

+11
-4
lines changed
  • quickwit/quickwit-search/src

1 file changed

+11
-4
lines changed

quickwit/quickwit-search/src/leaf.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use quickwit_storage::{
3939
};
4040
use tantivy::aggregation::agg_req::{AggregationVariants, Aggregations};
4141
use tantivy::aggregation::{AggContextParams, AggregationLimitsGuard};
42+
use tantivy::collector::Collector;
4243
use tantivy::directory::FileSlice;
4344
use tantivy::fastfield::FastFieldReaders;
4445
use tantivy::schema::Field;
@@ -500,15 +501,21 @@ async fn leaf_search_single_split(
500501
let mut collector =
501502
make_collector_for_split(split_id.clone(), &search_request, agg_context_params)?;
502503

504+
let predicate_cache = if collector.requires_scoring() {
505+
// at the moment the predicate cache doesn't support scoring
506+
None
507+
} else {
508+
Some((
509+
ctx.searcher_context.predicate_cache.clone() as _,
510+
split.split_id.clone(),
511+
))
512+
};
503513
let split_schema = index.schema();
504514
let (query, mut warmup_info) = ctx.doc_mapper.query(
505515
split_schema.clone(),
506516
query_ast.clone(),
507517
false,
508-
Some((
509-
ctx.searcher_context.predicate_cache.clone(),
510-
split.split_id.clone(),
511-
)),
518+
predicate_cache,
512519
)?;
513520

514521
let collector_warmup_info = collector.warmup_info();

0 commit comments

Comments
 (0)