8484import static org .apache .lucene .index .IndexWriter .MAX_TERM_LENGTH ;
8585import static org .elasticsearch .core .Strings .format ;
8686import static org .elasticsearch .index .IndexSettings .IGNORE_ABOVE_SETTING ;
87- import static org .elasticsearch .index .IndexSettings .USE_DOC_VALUES_SPARSE_INDEX ;
87+ import static org .elasticsearch .index .IndexSettings .USE_DOC_VALUES_SKIPPER ;
8888
8989/**
9090 * A field mapper for keywords. This mapper accepts strings and indexes them as-is.
@@ -202,7 +202,7 @@ public static final class Builder extends FieldMapper.DimensionBuilder {
202202 private final IndexAnalyzers indexAnalyzers ;
203203 private final ScriptCompiler scriptCompiler ;
204204 private final IndexVersion indexCreatedVersion ;
205- private final boolean useDocValuesSparseIndex ;
205+ private final boolean useDocValuesSkipper ;
206206
207207 public Builder (final String name , final MappingParserContext mappingParserContext ) {
208208 this (
@@ -213,7 +213,7 @@ public Builder(final String name, final MappingParserContext mappingParserContex
213213 mappingParserContext .getIndexSettings ().getIndexVersionCreated (),
214214 mappingParserContext .getIndexSettings ().getMode (),
215215 mappingParserContext .getIndexSettings ().getIndexSortConfig (),
216- USE_DOC_VALUES_SPARSE_INDEX .get (mappingParserContext .getSettings ())
216+ USE_DOC_VALUES_SKIPPER .get (mappingParserContext .getSettings ())
217217 );
218218 }
219219
@@ -235,7 +235,7 @@ private Builder(
235235 IndexVersion indexCreatedVersion ,
236236 IndexMode indexMode ,
237237 IndexSortConfig indexSortConfig ,
238- boolean useDocValuesSparseIndex
238+ boolean useDocValuesSkipper
239239 ) {
240240 super (name );
241241 this .indexAnalyzers = indexAnalyzers ;
@@ -272,7 +272,7 @@ private Builder(
272272 });
273273 this .indexSortConfig = indexSortConfig ;
274274 this .indexMode = indexMode ;
275- this .useDocValuesSparseIndex = useDocValuesSparseIndex ;
275+ this .useDocValuesSkipper = useDocValuesSkipper ;
276276 }
277277
278278 public Builder (String name , IndexVersion indexCreatedVersion ) {
@@ -400,7 +400,7 @@ private KeywordFieldType buildFieldType(MapperBuilderContext context, FieldType
400400 @ Override
401401 public KeywordFieldMapper build (MapperBuilderContext context ) {
402402 FieldType fieldtype = resolveFieldType (
403- useDocValuesSparseIndex ,
403+ useDocValuesSkipper ,
404404 indexCreatedVersion ,
405405 indexSortConfig ,
406406 indexMode ,
@@ -428,27 +428,27 @@ public KeywordFieldMapper build(MapperBuilderContext context) {
428428 buildFieldType (context , fieldtype ),
429429 builderParams (this , context ),
430430 context .isSourceSynthetic (),
431- useDocValuesSparseIndex ,
431+ useDocValuesSkipper ,
432432 this
433433 );
434434 }
435435
436436 private FieldType resolveFieldType (
437- final boolean useDocValuesSparseIndex ,
437+ final boolean useDocValuesSkipper ,
438438 final IndexVersion indexCreatedVersion ,
439439 final IndexSortConfig indexSortConfig ,
440440 final IndexMode indexMode ,
441441 final String fullFieldName
442442 ) {
443- if (useDocValuesSparseIndex
443+ if (useDocValuesSkipper
444444 && indexCreatedVersion .onOrAfter (IndexVersions .HOSTNAME_DOC_VALUES_SPARSE_INDEX )
445- && shouldUseDocValuesSparseIndex (hasDocValues .getValue (), indexSortConfig , indexMode , fullFieldName )) {
445+ && shouldUseDocValuesSkipper (hasDocValues .getValue (), indexSortConfig , indexMode , fullFieldName )) {
446446 return new FieldType (Defaults .FIELD_TYPE_WITH_SKIP_DOC_VALUES );
447447 }
448448 return new FieldType (Defaults .FIELD_TYPE );
449449 }
450450
451- private static boolean shouldUseDocValuesSparseIndex (
451+ private static boolean shouldUseDocValuesSkipper (
452452 final boolean hasDocValues ,
453453 final IndexSortConfig indexSortConfig ,
454454 final IndexMode indexMode ,
@@ -478,7 +478,7 @@ public static final class KeywordFieldType extends StringFieldType {
478478 private final boolean isSyntheticSource ;
479479 private final IndexMode indexMode ;
480480 private final IndexSortConfig indexSortConfig ;
481- private final boolean hasDocValuesSparseIndex ;
481+ private final boolean hasDocValuesSkipper ;
482482
483483 public KeywordFieldType (
484484 String name ,
@@ -506,7 +506,7 @@ public KeywordFieldType(
506506 this .isSyntheticSource = isSyntheticSource ;
507507 this .indexMode = builder .indexMode ;
508508 this .indexSortConfig = builder .indexSortConfig ;
509- this .hasDocValuesSparseIndex = DocValuesSkipIndexType .NONE .equals (fieldType .docValuesSkipIndexType ()) == false ;
509+ this .hasDocValuesSkipper = DocValuesSkipIndexType .NONE .equals (fieldType .docValuesSkipIndexType ()) == false ;
510510 }
511511
512512 public KeywordFieldType (String name , boolean isIndexed , boolean hasDocValues , Map <String , String > meta ) {
@@ -520,7 +520,7 @@ public KeywordFieldType(String name, boolean isIndexed, boolean hasDocValues, Ma
520520 this .isSyntheticSource = false ;
521521 this .indexMode = IndexMode .STANDARD ;
522522 this .indexSortConfig = null ;
523- this .hasDocValuesSparseIndex = false ;
523+ this .hasDocValuesSkipper = false ;
524524 }
525525
526526 public KeywordFieldType (String name ) {
@@ -545,7 +545,7 @@ public KeywordFieldType(String name, FieldType fieldType) {
545545 this .isSyntheticSource = false ;
546546 this .indexMode = IndexMode .STANDARD ;
547547 this .indexSortConfig = null ;
548- this .hasDocValuesSparseIndex = DocValuesSkipIndexType .NONE .equals (fieldType .docValuesSkipIndexType ()) == false ;
548+ this .hasDocValuesSkipper = DocValuesSkipIndexType .NONE .equals (fieldType .docValuesSkipIndexType ()) == false ;
549549 }
550550
551551 public KeywordFieldType (String name , NamedAnalyzer analyzer ) {
@@ -559,7 +559,7 @@ public KeywordFieldType(String name, NamedAnalyzer analyzer) {
559559 this .isSyntheticSource = false ;
560560 this .indexMode = IndexMode .STANDARD ;
561561 this .indexSortConfig = null ;
562- this .hasDocValuesSparseIndex = false ;
562+ this .hasDocValuesSkipper = false ;
563563 }
564564
565565 @ Override
@@ -1007,8 +1007,8 @@ public IndexSortConfig getIndexSortConfig() {
10071007 return indexSortConfig ;
10081008 }
10091009
1010- public boolean hasDocValuesSparseIndex () {
1011- return hasDocValuesSparseIndex ;
1010+ public boolean hasDocValuesSkipper () {
1011+ return hasDocValuesSkipper ;
10121012 }
10131013 }
10141014
@@ -1027,15 +1027,15 @@ public boolean hasDocValuesSparseIndex() {
10271027 private final int ignoreAboveDefault ;
10281028 private final IndexMode indexMode ;
10291029 private final IndexSortConfig indexSortConfig ;
1030- private final boolean useDocValuesSParseIndex ;
1030+ private final boolean useDocValuesSkipper ;
10311031
10321032 private KeywordFieldMapper (
10331033 String simpleName ,
10341034 FieldType fieldType ,
10351035 KeywordFieldType mappedFieldType ,
10361036 BuilderParams builderParams ,
10371037 boolean isSyntheticSource ,
1038- boolean useDocValuesSParseIndex ,
1038+ boolean useDocValuesSkipper ,
10391039 Builder builder
10401040 ) {
10411041 super (simpleName , mappedFieldType , builderParams );
@@ -1054,7 +1054,7 @@ private KeywordFieldMapper(
10541054 this .ignoreAboveDefault = builder .ignoreAboveDefault ;
10551055 this .indexMode = builder .indexMode ;
10561056 this .indexSortConfig = builder .indexSortConfig ;
1057- this .useDocValuesSParseIndex = useDocValuesSParseIndex ;
1057+ this .useDocValuesSkipper = useDocValuesSkipper ;
10581058 }
10591059
10601060 @ Override
@@ -1180,7 +1180,7 @@ public FieldMapper.Builder getMergeBuilder() {
11801180 indexCreatedVersion ,
11811181 indexMode ,
11821182 indexSortConfig ,
1183- useDocValuesSParseIndex
1183+ useDocValuesSkipper
11841184 ).dimension (fieldType ().isDimension ()).init (this );
11851185 }
11861186
0 commit comments