Skip to content

Commit 976f947

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 676a764 commit 976f947

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

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

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ protected void mappingWithIndexOptionsPruneFalse(XContentBuilder b) throws IOExc
198198
b.endObject();
199199
}
200200

201-
private void mapping(XContentBuilder b, @Nullable Boolean prune, PruningConfig pruningConfig)
202-
throws IOException {
201+
private void mapping(XContentBuilder b, @Nullable Boolean prune, PruningConfig pruningConfig) throws IOException {
203202
b.field("type", "sparse_vector");
204203
if (prune != null) {
205204
b.field("index_options", new SparseVectorFieldMapper.SparseVectorIndexOptions(prune, pruningConfig.tokenPruningConfig));
@@ -710,22 +709,17 @@ private enum PruningScenario {
710709
STRICT_PRUNING // Stricter pruning with higher thresholds
711710
}
712711

712+
private enum PruningConfig {
713+
NULL(null),
714+
EXPLICIT_DEFAULT(new TokenPruningConfig()),
715+
STRICT(new TokenPruningConfig(STRICT_TOKENS_FREQ_RATIO_THRESHOLD, STRICT_TOKENS_WEIGHT_THRESHOLD, false));
713716

714-
private enum PruningConfig {
715-
NULL(null),
716-
EXPLICIT_DEFAULT(new TokenPruningConfig()),
717-
STRICT(new TokenPruningConfig(
718-
STRICT_TOKENS_FREQ_RATIO_THRESHOLD,
719-
STRICT_TOKENS_WEIGHT_THRESHOLD,
720-
false
721-
));
722-
723-
public final @Nullable TokenPruningConfig tokenPruningConfig;
717+
public final @Nullable TokenPruningConfig tokenPruningConfig;
724718

725-
PruningConfig(@Nullable TokenPruningConfig tokenPruningConfig) {
726-
this.tokenPruningConfig = tokenPruningConfig;
727-
}
719+
PruningConfig(@Nullable TokenPruningConfig tokenPruningConfig) {
720+
this.tokenPruningConfig = tokenPruningConfig;
728721
}
722+
}
729723

730724
private final Set<PruningOptions> validIndexPruningScenarios = Set.of(
731725
new PruningOptions(false, PruningConfig.NULL),
@@ -844,11 +838,7 @@ private List<Query> getExpectedQueryClauses(
844838
private void assertPruningScenario(PruningOptions indexPruningOptions, PruningOptions queryPruningOptions) throws IOException {
845839
IndexVersion indexVersion = getIndexVersionForTest(randomBoolean());
846840
MapperService mapperService = createMapperService(indexVersion, getIndexMapping(indexPruningOptions));
847-
PruningScenario effectivePruningScenario = getEffectivePruningScenario(
848-
indexPruningOptions,
849-
queryPruningOptions,
850-
indexVersion
851-
);
841+
PruningScenario effectivePruningScenario = getEffectivePruningScenario(indexPruningOptions, queryPruningOptions, indexVersion);
852842
withSearchExecutionContext(mapperService, (context) -> {
853843
SparseVectorFieldMapper.SparseVectorFieldType ft = (SparseVectorFieldMapper.SparseVectorFieldType) mapperService.fieldType(
854844
"field"

0 commit comments

Comments
 (0)