We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4bb87c commit 1192271Copy full SHA for 1192271
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/search/SparseVectorQueryBuilder.java
@@ -351,6 +351,11 @@ public TransportVersion getMinimalSupportedVersion() {
351
}
352
353
private TokenPruningConfig getTokenPruningConfigForQuery(MappedFieldType ft, SearchExecutionContext context) {
354
+ // if we do not have an index reader, there can be no token pruning
355
+ if (context.getIndexReader() == null) {
356
+ return null;
357
+ }
358
+
359
// if we are not on a supported index version, do not prune by default
360
// nor do we check the index options
361
if (context.indexVersionCreated().onOrAfter(IndexVersions.SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_SUPPORT) == false
0 commit comments