File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
server/src/main/java/org/elasticsearch/index/mapper/vectors
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/search Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -144,13 +144,10 @@ private static SparseVectorFieldMapper.IndexOptions getDefaultIndexOptions(Mappi
144144 return new IndexOptions (false , null );
145145 }
146146
147- // index options are not set - for new indices, we
148- // need to set pruning to true by default
149- // with a default pruning configuration
150- return new IndexOptions (
151- true ,
152- new PruningConfig (PruningConfig .DEFAULT_TOKENS_FREQ_RATIO_THRESHOLD , PruningConfig .DEFAULT_TOKENS_WEIGHT_THRESHOLD )
153- );
147+ // index options are not set - for new indices,
148+ // if this is null, in the query will use the
149+ // proper defaults
150+ return null ;
154151 }
155152
156153 private static SparseVectorFieldMapper .IndexOptions parseIndexOptions (MappingParserContext context , Object propNode ) {
Original file line number Diff line number Diff line change @@ -418,7 +418,15 @@ private IndexFieldPruningSettings getIndexFieldPruningSettings(SparseVectorField
418418
419419 SparseVectorFieldMapper .IndexOptions indexOptions = sparseVectorFieldMapper .getIndexOptions ();
420420 if (indexOptions == null ) {
421- return new IndexFieldPruningSettings (null , null );
421+ // return the default if not set in the index options
422+ return new IndexFieldPruningSettings (
423+ true ,
424+ new TokenPruningConfig (
425+ TokenPruningConfig .DEFAULT_TOKENS_FREQ_RATIO_THRESHOLD ,
426+ TokenPruningConfig .DEFAULT_TOKENS_WEIGHT_THRESHOLD ,
427+ false
428+ )
429+ );
422430 }
423431
424432 Boolean indexOptionsPrune = indexOptions .getPrune ();
You can’t perform that action at this time.
0 commit comments