Skip to content

Commit 32c48d5

Browse files
authored
Fix KeywordFieldMapperTests in non-snapshot build runs (#137841)
KeywordFieldMapperTests was checking Settings directly for the presence of the USE_DOCVALUES_SKIPPERS flag, rather than going via IndexSettings.useDocValuesSkipper(), which meant that for non-snapshot builds the FeatureFlag was not being taken into account.
1 parent c6cab2e commit 32c48d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ public void testFieldTypeWithSkipDocValues_LogsDbMode() throws IOException {
982982
}));
983983

984984
final KeywordFieldMapper mapper = (KeywordFieldMapper) mapperService.documentMapper().mappers().getMapper("host.name");
985-
if (IndexSettings.USE_DOC_VALUES_SKIPPER.get(settings)) {
985+
if (mapperService.getIndexSettings().useDocValuesSkipper()) {
986986
assertTrue(mapper.fieldType().hasDocValuesSkipper());
987987
} else {
988988
assertFalse(mapper.fieldType().hasDocValuesSkipper());
@@ -1038,7 +1038,7 @@ public void testFieldTypeDefault_ConfiguredIndexedWithSettingOverride() throws I
10381038

10391039
final KeywordFieldMapper mapper = (KeywordFieldMapper) mapperService.documentMapper().mappers().getMapper("host.name");
10401040
assertTrue(mapper.fieldType().hasDocValues());
1041-
if (IndexSettings.USE_DOC_VALUES_SKIPPER.get(settings)) {
1041+
if (mapperService.getIndexSettings().useDocValuesSkipper()) {
10421042
assertTrue(mapper.fieldType().hasDocValuesSkipper());
10431043
} else {
10441044
assertFalse(mapper.fieldType().hasDocValuesSkipper());
@@ -1060,7 +1060,7 @@ public void testFieldTypeDefault_ConfiguredIndexedWithoutSettingOverride() throw
10601060

10611061
final KeywordFieldMapper mapper = (KeywordFieldMapper) mapperService.documentMapper().mappers().getMapper("host.name");
10621062
assertTrue(mapper.fieldType().hasDocValues());
1063-
if (IndexSettings.USE_DOC_VALUES_SKIPPER.get(settings)) {
1063+
if (mapperService.getIndexSettings().useDocValuesSkipper()) {
10641064
assertTrue(mapper.fieldType().hasDocValuesSkipper());
10651065
} else {
10661066
assertFalse(mapper.fieldType().hasDocValuesSkipper());
@@ -1082,7 +1082,7 @@ public void testFieldTypeDefault_ConfiguredDocValues() throws IOException {
10821082

10831083
final KeywordFieldMapper mapper = (KeywordFieldMapper) mapperService.documentMapper().mappers().getMapper("host.name");
10841084
assertTrue(mapper.fieldType().hasDocValues());
1085-
if (IndexSettings.USE_DOC_VALUES_SKIPPER.get(settings)) {
1085+
if (mapperService.getIndexSettings().useDocValuesSkipper()) {
10861086
assertTrue(mapper.fieldType().hasDocValuesSkipper());
10871087
} else {
10881088
assertFalse(mapper.fieldType().hasDocValuesSkipper());
@@ -1122,7 +1122,7 @@ public void testFieldTypeWithSkipDocValues_IndexedFalseDocValuesTrue() throws IO
11221122

11231123
final KeywordFieldMapper mapper = (KeywordFieldMapper) mapperService.documentMapper().mappers().getMapper("host.name");
11241124
assertTrue(mapper.fieldType().hasDocValues());
1125-
if (IndexSettings.USE_DOC_VALUES_SKIPPER.get(settings)) {
1125+
if (mapperService.getIndexSettings().useDocValuesSkipper()) {
11261126
assertTrue(mapper.fieldType().hasDocValuesSkipper());
11271127
} else {
11281128
assertFalse(mapper.fieldType().hasDocValuesSkipper());

0 commit comments

Comments
 (0)