Skip to content

Commit

Permalink
added index.mapping.non_text_fields.shared.inverted_index setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvg committed Jan 25, 2024
1 parent a880b2d commit 44a1390
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
MapperService.INDEX_MAPPING_DEPTH_LIMIT_SETTING,
MapperService.INDEX_MAPPING_DIMENSION_FIELDS_LIMIT_SETTING,
MapperService.INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING,
MapperService.INDEX_MAPPING_NON_TEXT_FIELDS_SHARED_INVERTED_INDEX,
BitsetFilterCache.INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING,
IndexModule.INDEX_STORE_TYPE_SETTING,
IndexModule.INDEX_STORE_PRE_LOAD_SETTING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import static org.elasticsearch.index.mapper.MapperService.INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING;
import static org.elasticsearch.index.mapper.MapperService.INDEX_MAPPING_NESTED_DOCS_LIMIT_SETTING;
import static org.elasticsearch.index.mapper.MapperService.INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING;
import static org.elasticsearch.index.mapper.MapperService.INDEX_MAPPING_NON_TEXT_FIELDS_SHARED_INVERTED_INDEX;
import static org.elasticsearch.index.mapper.MapperService.INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING;

/**
Expand Down Expand Up @@ -756,6 +757,7 @@ private void setRetentionLeaseMillis(final TimeValue retentionLease) {
private volatile long mappingDepthLimit;
private volatile long mappingFieldNameLengthLimit;
private volatile long mappingDimensionFieldsLimit;
private final boolean mappingNonTextFieldsSharedInvertedIndex;

/**
* The maximum number of refresh listeners allows on this shard.
Expand Down Expand Up @@ -900,6 +902,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
mappingDepthLimit = scopedSettings.get(INDEX_MAPPING_DEPTH_LIMIT_SETTING);
mappingFieldNameLengthLimit = scopedSettings.get(INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING);
mappingDimensionFieldsLimit = scopedSettings.get(INDEX_MAPPING_DIMENSION_FIELDS_LIMIT_SETTING);
mappingNonTextFieldsSharedInvertedIndex = scopedSettings.get(INDEX_MAPPING_NON_TEXT_FIELDS_SHARED_INVERTED_INDEX);
indexRouting = IndexRouting.fromIndexMetadata(indexMetadata);
es87TSDBCodecEnabled = scopedSettings.get(TIME_SERIES_ES87TSDB_CODEC_ENABLED_SETTING);

Expand Down Expand Up @@ -1543,6 +1546,10 @@ private void setMappingDimensionFieldsLimit(long value) {
this.mappingDimensionFieldsLimit = value;
}

public boolean isMappingNonTextFieldsSharedInvertedIndex() {
return mappingNonTextFieldsSharedInvertedIndex;
}

/**
* The bounds for {@code @timestamp} on this index or
* {@code null} if there are no bounds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ public enum MergeReason {
Property.Dynamic,
Property.IndexScope
);
public static final Setting<Boolean> INDEX_MAPPING_NON_TEXT_FIELDS_SHARED_INVERTED_INDEX = Setting.boolSetting(
"index.mapping.non_text_fields.shared.inverted_index",
false,
Property.IndexScope
);

private final IndexAnalyzers indexAnalyzers;
private final MappingParser mappingParser;
Expand Down

0 comments on commit 44a1390

Please sign in to comment.