@@ -515,8 +515,6 @@ private static boolean indexSortConfigByHostName(final IndexSortConfig indexSort
515515
516516 public static final class KeywordFieldType extends StringFieldType {
517517
518- private static final IndexMode DEFAULT_INDEX_MODE = IndexMode .STANDARD ;
519-
520518 private final int ignoreAbove ;
521519 private final int ignoreAboveDefaultValue ;
522520 private final String nullValue ;
@@ -525,7 +523,6 @@ public static final class KeywordFieldType extends StringFieldType {
525523 private final FieldValues <String > scriptValues ;
526524 private final boolean isDimension ;
527525 private final boolean isSyntheticSource ;
528- private final IndexMode indexMode ;
529526 private final IndexSortConfig indexSortConfig ;
530527 private final boolean hasDocValuesSkipper ;
531528 private final String originalName ;
@@ -555,7 +552,6 @@ public KeywordFieldType(
555552 this .scriptValues = builder .scriptValues ();
556553 this .isDimension = builder .dimension .getValue ();
557554 this .isSyntheticSource = isSyntheticSource ;
558- this .indexMode = builder .indexMode ;
559555 this .indexSortConfig = builder .indexSortConfig ;
560556 this .hasDocValuesSkipper = DocValuesSkipIndexType .NONE .equals (fieldType .docValuesSkipIndexType ()) == false ;
561557 this .originalName = isSyntheticSource ? name + "._original" : null ;
@@ -567,18 +563,13 @@ public KeywordFieldType(String name) {
567563
568564 public KeywordFieldType (String name , boolean isIndexed , boolean hasDocValues , Map <String , String > meta ) {
569565 super (name , isIndexed , false , hasDocValues , TextSearchInfo .SIMPLE_MATCH_ONLY , meta );
570-
571- final int ignoreAboveDefault = getIgnoreAboveDefaultValue (DEFAULT_INDEX_MODE , IndexVersion .current ());
572-
573566 this .normalizer = Lucene .KEYWORD_ANALYZER ;
574- this .ignoreAbove = ignoreAboveDefault ;
575- this .ignoreAboveDefaultValue = ignoreAboveDefault ;
567+ this .ignoreAbove = this .ignoreAboveDefaultValue = getIgnoreAboveDefaultValue (IndexMode .STANDARD , IndexVersion .current ());
576568 this .nullValue = null ;
577569 this .eagerGlobalOrdinals = false ;
578570 this .scriptValues = null ;
579571 this .isDimension = false ;
580572 this .isSyntheticSource = false ;
581- this .indexMode = DEFAULT_INDEX_MODE ;
582573 this .indexSortConfig = null ;
583574 this .hasDocValuesSkipper = false ;
584575 this .originalName = null ;
@@ -593,37 +584,27 @@ public KeywordFieldType(String name, FieldType fieldType) {
593584 textSearchInfo (fieldType , null , Lucene .KEYWORD_ANALYZER , Lucene .KEYWORD_ANALYZER ),
594585 Collections .emptyMap ()
595586 );
596-
597- final int ignoreAboveDefault = getIgnoreAboveDefaultValue (DEFAULT_INDEX_MODE , IndexVersion .current ());
598-
599587 this .normalizer = Lucene .KEYWORD_ANALYZER ;
600- this .ignoreAbove = ignoreAboveDefault ;
601- this .ignoreAboveDefaultValue = ignoreAboveDefault ;
588+ this .ignoreAbove = this .ignoreAboveDefaultValue = getIgnoreAboveDefaultValue (IndexMode .STANDARD , IndexVersion .current ());
602589 this .nullValue = null ;
603590 this .eagerGlobalOrdinals = false ;
604591 this .scriptValues = null ;
605592 this .isDimension = false ;
606593 this .isSyntheticSource = false ;
607- this .indexMode = DEFAULT_INDEX_MODE ;
608594 this .indexSortConfig = null ;
609595 this .hasDocValuesSkipper = DocValuesSkipIndexType .NONE .equals (fieldType .docValuesSkipIndexType ()) == false ;
610596 this .originalName = null ;
611597 }
612598
613599 public KeywordFieldType (String name , NamedAnalyzer analyzer ) {
614600 super (name , true , false , true , textSearchInfo (Defaults .FIELD_TYPE , null , analyzer , analyzer ), Collections .emptyMap ());
615-
616- final int ignoreAboveDefault = getIgnoreAboveDefaultValue (DEFAULT_INDEX_MODE , IndexVersion .current ());
617-
618601 this .normalizer = Lucene .KEYWORD_ANALYZER ;
619- this .ignoreAbove = ignoreAboveDefault ;
620- this .ignoreAboveDefaultValue = ignoreAboveDefault ;
602+ this .ignoreAbove = this .ignoreAboveDefaultValue = getIgnoreAboveDefaultValue (IndexMode .STANDARD , IndexVersion .current ());
621603 this .nullValue = null ;
622604 this .eagerGlobalOrdinals = false ;
623605 this .scriptValues = null ;
624606 this .isDimension = false ;
625607 this .isSyntheticSource = false ;
626- this .indexMode = DEFAULT_INDEX_MODE ;
627608 this .indexSortConfig = null ;
628609 this .hasDocValuesSkipper = false ;
629610 this .originalName = null ;
@@ -1076,10 +1057,6 @@ public boolean hasNormalizer() {
10761057 return normalizer != Lucene .KEYWORD_ANALYZER ;
10771058 }
10781059
1079- public IndexMode getIndexMode () {
1080- return indexMode ;
1081- }
1082-
10831060 public IndexSortConfig getIndexSortConfig () {
10841061 return indexSortConfig ;
10851062 }
0 commit comments