Skip to content

Commit f0f0279

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 4be9290 commit f0f0279

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public class SparseVectorFieldMapper extends FieldMapper {
8383
static final IndexVersion NEW_SPARSE_VECTOR_INDEX_VERSION = IndexVersions.NEW_SPARSE_VECTOR;
8484
static final IndexVersion SPARSE_VECTOR_IN_FIELD_NAMES_INDEX_VERSION = IndexVersions.SPARSE_VECTOR_IN_FIELD_NAMES_SUPPORT;
8585
static final IndexVersion SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_VERSION = IndexVersions.SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_SUPPORT;
86-
static final IndexVersion SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_VERSION_8_X = IndexVersions.SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_SUPPORT_BACKPORT_8_X;
86+
static final IndexVersion SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_VERSION_8_X =
87+
IndexVersions.SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_SUPPORT_BACKPORT_8_X;
8788

8889
public static final NodeFeature SPARSE_VECTOR_INDEX_OPTIONS_FEATURE = new NodeFeature("sparse_vector.index_options_supported");
8990

@@ -180,7 +181,12 @@ public SparseVectorFieldType(String name, boolean isStored, Map<String, String>
180181
this(name, isStored, meta, null);
181182
}
182183

183-
public SparseVectorFieldType(String name, boolean isStored, Map<String, String> meta, @Nullable SparseVectorFieldMapper.IndexOptions indexOptions) {
184+
public SparseVectorFieldType(
185+
String name,
186+
boolean isStored,
187+
Map<String, String> meta,
188+
@Nullable SparseVectorFieldMapper.IndexOptions indexOptions
189+
) {
184190
super(name, true, isStored, false, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
185191
this.indexOptions = indexOptions;
186192
}
@@ -265,8 +271,7 @@ private TokenPruningConfig getDefaultPruningConfig(SearchExecutionContext contex
265271
return new TokenPruningConfig();
266272
}
267273

268-
if (indexVersion.between(SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_VERSION_8_X, IndexVersions.UPGRADE_TO_LUCENE_10_0_0))
269-
{
274+
if (indexVersion.between(SPARSE_VECTOR_PRUNING_INDEX_OPTIONS_VERSION_8_X, IndexVersions.UPGRADE_TO_LUCENE_10_0_0)) {
270275
// default pruning for 8.19.0+ is true for this index
271276
return new TokenPruningConfig();
272277
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/search/SparseVectorQueryBuilder.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import org.elasticsearch.common.io.stream.StreamInput;
1818
import org.elasticsearch.common.io.stream.StreamOutput;
1919
import org.elasticsearch.core.Nullable;
20-
import org.elasticsearch.index.IndexVersion;
21-
import org.elasticsearch.index.IndexVersions;
2220
import org.elasticsearch.index.mapper.MappedFieldType;
2321
import org.elasticsearch.index.mapper.vectors.SparseVectorFieldMapper;
2422
import org.elasticsearch.index.mapper.vectors.TokenPruningConfig;
@@ -132,8 +130,7 @@ public SparseVectorQueryBuilder(StreamInput in) throws IOException {
132130
this.fieldName = in.readString();
133131

134132
if (in.getTransportVersion().isPatchFrom(SPARSE_VECTOR_FIELD_PRUNING_OPTIONS_8_19)
135-
|| in.getTransportVersion().onOrAfter(SPARSE_VECTOR_FIELD_PRUNING_OPTIONS)
136-
) {
133+
|| in.getTransportVersion().onOrAfter(SPARSE_VECTOR_FIELD_PRUNING_OPTIONS)) {
137134
this.shouldPruneTokens = in.readOptionalBoolean();
138135
} else {
139136
this.shouldPruneTokens = in.readBoolean();
@@ -189,8 +186,7 @@ protected void doWriteTo(StreamOutput out) throws IOException {
189186
out.writeString(fieldName);
190187

191188
if (out.getTransportVersion().isPatchFrom(SPARSE_VECTOR_FIELD_PRUNING_OPTIONS_8_19)
192-
|| out.getTransportVersion().onOrAfter(SPARSE_VECTOR_FIELD_PRUNING_OPTIONS)
193-
) {
189+
|| out.getTransportVersion().onOrAfter(SPARSE_VECTOR_FIELD_PRUNING_OPTIONS)) {
194190
out.writeOptionalBoolean(shouldPruneTokens);
195191
} else {
196192
out.writeBoolean(shouldPruneTokens);
@@ -219,7 +215,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep
219215
builder.field(QUERY_FIELD.getPreferredName(), query);
220216
}
221217
if (shouldPruneTokens != null) {
222-
builder.field(PRUNE_FIELD.getPreferredName(), shouldPruneTokens);
218+
builder.field(PRUNE_FIELD.getPreferredName(), shouldPruneTokens);
223219
}
224220
if (tokenPruningConfig != null) {
225221
builder.field(PRUNING_CONFIG_FIELD.getPreferredName(), tokenPruningConfig);

0 commit comments

Comments
 (0)