Skip to content

Commit ab5cea5

Browse files
committed
Change variable name
1 parent 5eba99c commit ab5cea5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

server/src/main/java/org/elasticsearch/index/mapper/InferenceMetadataFieldsMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public abstract class InferenceMetadataFieldsMapper extends MetadataFieldMapper
4444

4545
// Check index version SOURCE_MAPPER_MODE_ATTRIBUTE_NOOP because that index version was added in the same serverless promotion
4646
// where the new format was enabled by default
47-
public static final IndexVersion USE_NEW_FORMAT_BY_DEFAULT = IndexVersions.SOURCE_MAPPER_MODE_ATTRIBUTE_NOOP;
47+
public static final IndexVersion USE_NEW_SEMANTIC_TEXT_FORMAT_BY_DEFAULT = IndexVersions.SOURCE_MAPPER_MODE_ATTRIBUTE_NOOP;
4848

4949
public static final String NAME = "_inference_fields";
5050
public static final String CONTENT_TYPE = "_inference_fields";
@@ -93,7 +93,7 @@ public static boolean isEnabled(Settings settings) {
9393
var version = IndexMetadata.SETTING_INDEX_VERSION_CREATED.get(settings);
9494
if ((version.before(IndexVersions.INFERENCE_METADATA_FIELDS)
9595
&& version.between(IndexVersions.INFERENCE_METADATA_FIELDS_BACKPORT, IndexVersions.UPGRADE_TO_LUCENE_10_0_0) == false)
96-
|| (version.before(USE_NEW_FORMAT_BY_DEFAULT) && USE_LEGACY_SEMANTIC_TEXT_FORMAT.exists(settings) == false)) {
96+
|| (version.before(USE_NEW_SEMANTIC_TEXT_FORMAT_BY_DEFAULT) && USE_LEGACY_SEMANTIC_TEXT_FORMAT.exists(settings) == false)) {
9797
return false;
9898
}
9999

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,16 @@ public void testIsEnabledByDefault() {
5959
var settings = Settings.builder()
6060
.put(
6161
IndexMetadata.SETTING_INDEX_VERSION_CREATED.getKey(),
62-
IndexVersionUtils.getPreviousVersion(InferenceMetadataFieldsMapper.USE_NEW_FORMAT_BY_DEFAULT)
62+
IndexVersionUtils.getPreviousVersion(InferenceMetadataFieldsMapper.USE_NEW_SEMANTIC_TEXT_FORMAT_BY_DEFAULT)
6363
)
6464
.build();
6565
assertFalse(InferenceMetadataFieldsMapper.isEnabled(settings));
6666

6767
settings = Settings.builder()
68-
.put(IndexMetadata.SETTING_INDEX_VERSION_CREATED.getKey(), InferenceMetadataFieldsMapper.USE_NEW_FORMAT_BY_DEFAULT)
68+
.put(
69+
IndexMetadata.SETTING_INDEX_VERSION_CREATED.getKey(),
70+
InferenceMetadataFieldsMapper.USE_NEW_SEMANTIC_TEXT_FORMAT_BY_DEFAULT
71+
)
6972
.build();
7073
assertTrue(InferenceMetadataFieldsMapper.isEnabled(settings));
7174
}

0 commit comments

Comments
 (0)