Skip to content

Commit e95033c

Browse files
committed
light cleanups
1 parent 6a7f46c commit e95033c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

server/src/main/java/org/elasticsearch/index/mapper/vectors/SparseVectorFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ public static Boolean parseIndexOptionsPruneValue(Map<String, Object> indexOptio
516516
public static PruningConfig parseIndexOptionsPruningConfig(Boolean prune, Map<String, Object> indexOptionsMap) {
517517
Object pruningConfiguration = indexOptionsMap.remove(IndexOptions.PRUNING_CONFIG_FIELD_NAME);
518518
if (pruningConfiguration == null) {
519-
return new PruningConfig(PruningConfig.DEFAULT_TOKENS_FREQ_RATIO_THRESHOLD, PruningConfig.DEFAULT_TOKENS_WEIGHT_THRESHOLD);
519+
return null;
520520
}
521521
if ((pruningConfiguration instanceof Map) == false) {
522522
throw new MapperParsingException("[index_options] field [pruning_config] should be a map");

server/src/test/java/org/elasticsearch/index/mapper/vectors/SparseVectorFieldMapperTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ public void testDefaults() throws Exception {
151151
public void testWithIndexOptionsPrune() throws Exception {
152152
DocumentMapper mapper = createDocumentMapper(fieldMapping(this::mappingWithIndexOptionsPrune));
153153
String expectedMapping = "{\"_doc\":{\"properties\":{\"field\":{\"type\":\"sparse_vector\",\"index_options\":"
154-
+ "{\"prune\":true,\"pruning_config\":{\"tokens_freq_ratio_threshold\":5.0,\"tokens_weight_threshold\":0.4}}"
155-
+ "}}}}";
154+
+ "{\"prune\":true}}}}}";
156155
assertEquals(expectedMapping, mapper.mappingSource().toString());
157156

158157
ParsedDocument doc1 = mapper.parse(source(this::writeField));

0 commit comments

Comments
 (0)