Skip to content

Commit 58f9909

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 19fe72d commit 58f9909

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ public SparseVectorFieldMapper build(MapperBuilderContext context) {
115115
IndexOptions buildIndexOptions = indexOptions.getValue();
116116

117117
if (buildIndexOptions == null) {
118-
buildIndexOptions = new IndexOptions(true,
118+
buildIndexOptions = new IndexOptions(
119+
true,
119120
new PruningConfig(PruningConfig.DEFAULT_TOKENS_FREQ_RATIO_THRESHOLD, PruningConfig.DEFAULT_TOKENS_WEIGHT_THRESHOLD)
120121
);
121122
}
@@ -144,7 +145,8 @@ private static SparseVectorFieldMapper.IndexOptions getDefaultIndexOptions(Mappi
144145
// index options are not set - for new indices, we
145146
// need to set pruning to true by default
146147
// with a default pruning configuration
147-
return new IndexOptions(true,
148+
return new IndexOptions(
149+
true,
148150
new PruningConfig(PruningConfig.DEFAULT_TOKENS_FREQ_RATIO_THRESHOLD, PruningConfig.DEFAULT_TOKENS_WEIGHT_THRESHOLD)
149151
);
150152
}

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

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,10 @@ public void testTokensFreqRatioCorrect() {
311311
b.endObject();
312312
b.endObject();
313313
})));
314-
assertThat(eTestInteger.getMessage(), containsString("[pruning_config] field [tokens_freq_ratio_threshold] field should be an integer between 1 and 100"));
314+
assertThat(
315+
eTestInteger.getMessage(),
316+
containsString("[pruning_config] field [tokens_freq_ratio_threshold] field should be an integer between 1 and 100")
317+
);
315318

316319
Exception eTestRangeLower = expectThrows(MapperParsingException.class, () -> createMapperService(fieldMapping(b -> {
317320
b.field("type", "sparse_vector");
@@ -321,7 +324,10 @@ public void testTokensFreqRatioCorrect() {
321324
b.endObject();
322325
b.endObject();
323326
})));
324-
assertThat(eTestRangeLower.getMessage(), containsString("[pruning_config] field [tokens_freq_ratio_threshold] field should be an integer between 1 and 100"));
327+
assertThat(
328+
eTestRangeLower.getMessage(),
329+
containsString("[pruning_config] field [tokens_freq_ratio_threshold] field should be an integer between 1 and 100")
330+
);
325331

326332
Exception eTestRangeHigher = expectThrows(MapperParsingException.class, () -> createMapperService(fieldMapping(b -> {
327333
b.field("type", "sparse_vector");
@@ -331,7 +337,10 @@ public void testTokensFreqRatioCorrect() {
331337
b.endObject();
332338
b.endObject();
333339
})));
334-
assertThat(eTestRangeHigher.getMessage(), containsString("[pruning_config] field [tokens_freq_ratio_threshold] field should be an integer between 1 and 100"));
340+
assertThat(
341+
eTestRangeHigher.getMessage(),
342+
containsString("[pruning_config] field [tokens_freq_ratio_threshold] field should be an integer between 1 and 100")
343+
);
335344
}
336345

337346
public void testTokensWeightThresholdCorrect() {
@@ -343,7 +352,10 @@ public void testTokensWeightThresholdCorrect() {
343352
b.endObject();
344353
b.endObject();
345354
})));
346-
assertThat(eTestDouble.getMessage(), containsString("[pruning_config] field [tokens_weight_threshold] field should be an number between 0.0 and 1.0"));
355+
assertThat(
356+
eTestDouble.getMessage(),
357+
containsString("[pruning_config] field [tokens_weight_threshold] field should be an number between 0.0 and 1.0")
358+
);
347359

348360
Exception eTestRangeLower = expectThrows(MapperParsingException.class, () -> createMapperService(fieldMapping(b -> {
349361
b.field("type", "sparse_vector");
@@ -353,7 +365,10 @@ public void testTokensWeightThresholdCorrect() {
353365
b.endObject();
354366
b.endObject();
355367
})));
356-
assertThat(eTestRangeLower.getMessage(), containsString("[pruning_config] field [tokens_weight_threshold] field should be an number between 0.0 and 1.0"));
368+
assertThat(
369+
eTestRangeLower.getMessage(),
370+
containsString("[pruning_config] field [tokens_weight_threshold] field should be an number between 0.0 and 1.0")
371+
);
357372

358373
Exception eTestRangeHigher = expectThrows(MapperParsingException.class, () -> createMapperService(fieldMapping(b -> {
359374
b.field("type", "sparse_vector");
@@ -363,7 +378,10 @@ public void testTokensWeightThresholdCorrect() {
363378
b.endObject();
364379
b.endObject();
365380
})));
366-
assertThat(eTestRangeHigher.getMessage(), containsString("[pruning_config] field [tokens_weight_threshold] field should be an number between 0.0 and 1.0"));
381+
assertThat(
382+
eTestRangeHigher.getMessage(),
383+
containsString("[pruning_config] field [tokens_weight_threshold] field should be an number between 0.0 and 1.0")
384+
);
367385
}
368386

369387
public void testStoreIsNotUpdateable() throws IOException {

0 commit comments

Comments
 (0)