Skip to content

Commit 6894d16

Browse files
authored
Do not cache SingleValueQuery.LuceneQuery (#110082) (#110091)
If the query gets cached, then it won't be able to emit warnings for multivalue fields.
1 parent 5348ba2 commit 6894d16

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/querydsl/query/SingleValueQuery.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ private Scorer scorer(Scorer nextScorer, LeafFieldData lfd) {
452452

453453
@Override
454454
public boolean isCacheable(LeafReaderContext ctx) {
455-
return next.isCacheable(ctx);
455+
// we cannot cache this query because we loose the ability of emitting warnings
456+
return false;
456457
}
457458
}
458459

0 commit comments

Comments
 (0)