Skip to content

Commit db05915

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 46d0f47 commit db05915

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@
130130
*/
131131
public class SemanticTextFieldMapper extends FieldMapper implements InferenceFieldMapper {
132132
private static final Logger logger = LogManager.getLogger(SemanticTextFieldMapper.class);
133-
public static final String WARNING_MESSAGE_8X = "Creating a `semantic_text` field on this index version may not include" +
134-
" optimized default settings. Consider creating a new index for a better performance.";
135-
public static final String ERROR_MESSAGE_UNSUPPORTED_SPARSE_VECTOR = "Creating a `semantic_text` field with `sparse_vector` models" +
136-
" is not supported on indices created with versions 8.0-8.10." +
137-
" Try using a `dense_vector` model or create a new index with version 8.11+.";
133+
public static final String WARNING_MESSAGE_8X = "Creating a `semantic_text` field on this index version may not include"
134+
+ " optimized default settings. Consider creating a new index for a better performance.";
135+
public static final String ERROR_MESSAGE_UNSUPPORTED_SPARSE_VECTOR = "Creating a `semantic_text` field with `sparse_vector` models"
136+
+ " is not supported on indices created with versions 8.0-8.10."
137+
+ " Try using a `dense_vector` model or create a new index with version 8.11+.";
138138
public static final NodeFeature SEMANTIC_TEXT_IN_OBJECT_FIELD_FIX = new NodeFeature("semantic_text.in_object_field_fix");
139139
public static final NodeFeature SEMANTIC_TEXT_SINGLE_FIELD_UPDATE_FIX = new NodeFeature("semantic_text.single_field_update_fix");
140140
public static final NodeFeature SEMANTIC_TEXT_DELETE_FIX = new NodeFeature("semantic_text.delete_fix");

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1111

12-
import org.apache.logging.log4j.Level;
1312
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat;
1413
import org.apache.lucene.document.FeatureField;
1514
import org.apache.lucene.index.FieldInfo;
@@ -28,23 +27,15 @@
2827
import org.apache.lucene.search.join.ScoreMode;
2928
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
3029
import org.elasticsearch.cluster.ClusterChangedEvent;
31-
import org.elasticsearch.cluster.metadata.DataStreamGlobalRetention;
32-
import org.elasticsearch.cluster.metadata.DataStreamLifecycle;
3330
import org.elasticsearch.cluster.metadata.IndexMetadata;
3431
import org.elasticsearch.common.CheckedBiConsumer;
3532
import org.elasticsearch.common.CheckedBiFunction;
3633
import org.elasticsearch.common.Strings;
3734
import org.elasticsearch.common.bytes.BytesReference;
3835
import org.elasticsearch.common.compress.CompressedXContent;
39-
import org.elasticsearch.common.logging.DeprecatedMessage;
40-
import org.elasticsearch.common.logging.DeprecationLogger;
41-
import org.elasticsearch.common.logging.ESLogMessage;
42-
import org.elasticsearch.common.logging.HeaderWarning;
4336
import org.elasticsearch.common.lucene.search.Queries;
4437
import org.elasticsearch.common.settings.Settings;
45-
import org.elasticsearch.common.util.concurrent.ThreadContext;
4638
import org.elasticsearch.core.CheckedConsumer;
47-
import org.elasticsearch.core.TimeValue;
4839
import org.elasticsearch.index.IndexVersion;
4940
import org.elasticsearch.index.IndexVersions;
5041
import org.elasticsearch.index.mapper.DocumentMapper;
@@ -427,9 +418,7 @@ public void testInvalidTaskTypes() {
427418

428419
@Override
429420
protected String[] getParseMinimalWarnings() {
430-
return new String[] {
431-
WARNING_MESSAGE_8X
432-
};
421+
return new String[] { WARNING_MESSAGE_8X };
433422
}
434423

435424
public void testOldIndexSemanticTextDenseVectorCreation() throws IOException {
@@ -449,7 +438,8 @@ public void testOldIndexSemanticTextDenseVectorCreation() throws IOException {
449438
fieldMapping,
450439
true,
451440
IndexVersions.V_8_0_0,
452-
IndexVersionUtils.getPreviousVersion(IndexVersions.FIRST_DETACHED_INDEX_VERSION));
441+
IndexVersionUtils.getPreviousVersion(IndexVersions.FIRST_DETACHED_INDEX_VERSION)
442+
);
453443
assertParseMinimalWarnings();
454444
assertSemanticTextField(mapperService, fieldName, true, null, null);
455445
}
@@ -463,11 +453,15 @@ public void testOldIndexSemanticTextSparseVersionRaisesError() throws IOExceptio
463453
b.endObject();
464454
});
465455

466-
MapperParsingException exception = assertThrows(MapperParsingException.class, () -> createMapperService(
467-
fieldMapping,
468-
true,
469-
IndexVersions.V_8_0_0,
470-
IndexVersionUtils.getPreviousVersion(IndexVersions.NEW_SPARSE_VECTOR)));
456+
MapperParsingException exception = assertThrows(
457+
MapperParsingException.class,
458+
() -> createMapperService(
459+
fieldMapping,
460+
true,
461+
IndexVersions.V_8_0_0,
462+
IndexVersionUtils.getPreviousVersion(IndexVersions.NEW_SPARSE_VECTOR)
463+
)
464+
);
471465
assertTrue(exception.getMessage().contains(ERROR_MESSAGE_UNSUPPORTED_SPARSE_VECTOR));
472466
assertTrue(exception.getRootCause() instanceof IllegalArgumentException);
473467
}

0 commit comments

Comments
 (0)