Package org.elasticsearch.index
Class IndexSettings
java.lang.Object
org.elasticsearch.index.IndexSettings
This class encapsulates all index level settings and handles settings updates.
 It's created per index and available to all index level classes and allows them to retrieve
 the latest updated settings instance. Classes that need to listen to settings updates can register
 a settings consumer at index creation via 
IndexModule.addSettingsUpdateConsumer(Setting, Consumer) that will
 be called for each settings update.- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic org.elasticsearch.core.TimeValueIndex setting to enable / disable deletes garbage collection.static org.elasticsearch.core.TimeValueDetermines a balance between file-based and operations-based peer recoveries.static Setting<ByteSizeValue>The minimum size of a merge that triggers a flush in order to free resourcesstatic Setting<org.elasticsearch.core.TimeValue>static Setting<org.elasticsearch.core.TimeValue>static Setting<org.elasticsearch.core.TimeValue>Marks an index to be searched throttled.static Setting<org.elasticsearch.core.TimeValue>Controls the maximum length of time since a retention lease is created or renewed before it is considered expired.Controls how many soft-deleted documents will be kept around before being merged away.Specifies if the index should use soft-delete instead of hard-delete for update/delete operations.static Setting<Translog.Durability>static Setting<ByteSizeValue>static Setting<ByteSizeValue>The maximum size of a translog generation.static Setting<org.elasticsearch.core.TimeValue>Controls how long translog files that are no longer needed for persistence reasons will be kept around before being deleted.static Setting<ByteSizeValue>Controls how many translog files that are no longer needed for persistence reasons will be kept around before being deleted.Controls the number of translog files that are no longer needed for persistence reasons will be kept around before being deleted.static Setting<org.elasticsearch.core.TimeValue>Index setting describing the maximum number of filters clauses that can be used in an adjacency_matrix aggregation.A setting describing the maximum number of characters that will be analyzed for a highlight request.Index setting describing the maximum value of allowed `docvalue_fields`that can be retrieved per search request.Index setting describing the maximum value of from + size on an individual inner hit definition or top hits aggregation.Index setting describing for NGramTokenizer and NGramTokenFilter the maximum difference between max_gram (maximum length of characters in a gram) and min_gram (minimum length of characters in a gram).The maximum number of refresh listeners allows on this shard.The maximum length of regex string allowed in a regexp query.Index setting describing the maximum size of the rescore window.Index setting describing the maximum value of from + size on a query.Index setting describing the maximum value of allowed `script_fields`that can be retrieved per search request.Index setting describing for ShingleTokenFilter the maximum difference between max_shingle_size and min_shingle_size.The maximum number of slices allowed in a scroll requestIndex setting describing the maximum number of terms that can be used in Terms Query.A setting describing the maximum number of tokens that can be produced using _analyze API.
- 
Constructor SummaryConstructorsConstructorDescriptionIndexSettings(IndexMetadata indexMetadata, Settings nodeSettings)Creates a newIndexSettingsinstance.IndexSettings(IndexMetadata indexMetadata, Settings nodeSettings, IndexScopedSettings indexScopedSettings)Creates a newIndexSettingsinstance.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the customDataPath for this index, if configured.Returns the default search fields for this index.Returns the merge threshold size when to forcefully flush the index and free resources.Returns the transaction log threshold size when to forcefully flush the index and clear the transaction log.longReturns the GC deletes cycle in milliseconds.Returns the generation threshold size.intReturns the maximum number of chars that will be analyzed in a highlight requestgetIndex()Returns the index this settings object belongs toReturns the current IndexMetadata for this indexReturns the index sort config that should be used for this index.Returns the version the index was created on.longlonglonglonglongintDeprecated.This setting will be removed in 8.0intReturns the maximum number of allowed docvalue_fields to retrieve in a search requestintReturns the max result window for an individual inner hit definition or top hits aggregation.intReturns the maximum allowed difference between max and min length of ngramintThe maximum number of refresh listeners allows on this shard.intThe maximum length of regex string allowed in a regexp query.intReturns the maximum rescore window for search requests.intReturns the max result window for search requests, describing the maximum value of from + size on a query.intReturns the maximum number of allowed script_fields to retrieve in a search requestintReturns the maximum allowed difference between max and min shingle_sizeintThe maximum number of slices allowed in a scroll request.intReturns the maximum number of terms that can be used in a Terms Query requestintReturns the maximum number of tokens that can be producedorg.apache.lucene.index.MergePolicyReturns the merge policy that should be used for this index.Returns theMergeSchedulerConfigReturns the current node nameReturns the node settings.intReturns the number of replicas this index has.intReturns the number of shards this index has.org.elasticsearch.core.TimeValueReturns this interval in which the shards of this index are asynchronously refreshed.longThe maximum age of a retention lease before it is considered expired.org.elasticsearch.core.TimeValueReturns the time that an index shard becomes search idle unless it's accessed in betweenReturns the settings for this index.longReturns the number of extra operations (i.e.Returns the translog durability for this index.org.elasticsearch.core.TimeValueReturns the transaction log retention age which controls the maximum age (time from creation) that translog files will be kept aroundReturns the transaction log retention size which controls how much of the translog is kept around to allow for ops based recoveriesintReturns the maximum number of translog files that that no longer required for persistence should be kept for peer recovery when soft-deletes is disabled.org.elasticsearch.core.TimeValueReturns the translog sync interval.getUUID()Returns the indexes UUID<T> TbooleanReturnstrueif the index has a custom data pathbooleanReturnstrueif queries should be lenient about unmapped fields.booleanReturns true iff the refresh setting exists or in other words is explicitly set.booleanReturnstrueif the query string parser should allow leading wildcards.booleanReturnstrueif the query string should analyze wildcards.booleanReturnstrueif query string parsing should be lenient.booleanReturns true if the this index should be searched throttled ie.booleanReturnstrueif soft-delete is enabled.booleanReturns true if index warmers are enabled, otherwisefalsestatic booleanCompare the specified settings for equality.voidsetDefaultPipeline(String defaultPipeline)voidsetRequiredPipeline(String requiredPipeline)voidsetTranslogSyncInterval(org.elasticsearch.core.TimeValue translogSyncInterval)booleanupdateIndexMetadata(IndexMetadata indexMetadata)Updates the settings and index metadata and notifies all registered settings consumers with the new settings iff at least one setting has changed.
- 
Field Details- 
DEFAULT_FIELD_SETTING
- 
QUERY_STRING_LENIENT_SETTING
- 
QUERY_STRING_ANALYZE_WILDCARD
- 
QUERY_STRING_ALLOW_LEADING_WILDCARD
- 
ALLOW_UNMAPPED
- 
INDEX_TRANSLOG_SYNC_INTERVAL_SETTING
- 
INDEX_SEARCH_IDLE_AFTER
- 
INDEX_TRANSLOG_DURABILITY_SETTING
- 
INDEX_WARMER_ENABLED_SETTING
- 
INDEX_CHECK_ON_STARTUP
- 
MAX_RESULT_WINDOW_SETTINGIndex setting describing the maximum value of from + size on a query. The Default maximum value of from + size on a query is 10,000. This was chosen as a conservative default as it is sure to not cause trouble. Users can certainly profile their cluster and decide to set it to 100,000 safely. 1,000,000 is probably way to high for any cluster to set safely.
- 
MAX_INNER_RESULT_WINDOW_SETTINGIndex setting describing the maximum value of from + size on an individual inner hit definition or top hits aggregation. The default maximum of 100 is defensive for the reason that the number of inner hit responses and number of top hits buckets returned is unbounded. Profile your cluster when increasing this setting.
- 
MAX_SCRIPT_FIELDS_SETTINGIndex setting describing the maximum value of allowed `script_fields`that can be retrieved per search request. The default maximum of 32 is defensive for the reason that retrieving script fields is a costly operation.
- 
MAX_TOKEN_COUNT_SETTINGA setting describing the maximum number of tokens that can be produced using _analyze API. The default maximum of 10000 is defensive to prevent generating too many token objects.
- 
MAX_ANALYZED_OFFSET_SETTINGA setting describing the maximum number of characters that will be analyzed for a highlight request. This setting is only applicable when highlighting is requested on a text that was indexed without offsets or term vectors. The default maximum of 1M characters is defensive as for highlighting larger texts, indexing with offsets or term vectors is recommended.
- 
MAX_TERMS_COUNT_SETTINGIndex setting describing the maximum number of terms that can be used in Terms Query. The default maximum of 65536 terms is defensive, as extra processing and memory is involved for each additional term, and a large number of terms degrade the cluster performance.
- 
MAX_NGRAM_DIFF_SETTINGIndex setting describing for NGramTokenizer and NGramTokenFilter the maximum difference between max_gram (maximum length of characters in a gram) and min_gram (minimum length of characters in a gram). The default value is 1 as this is default difference in NGramTokenizer, and is defensive as it prevents generating too many index terms.
- 
MAX_SHINGLE_DIFF_SETTINGIndex setting describing for ShingleTokenFilter the maximum difference between max_shingle_size and min_shingle_size. The default value is 3 is defensive as it prevents generating too many tokens.
- 
MAX_DOCVALUE_FIELDS_SEARCH_SETTINGIndex setting describing the maximum value of allowed `docvalue_fields`that can be retrieved per search request. The default maximum of 100 is defensive for the reason that retrieving doc values might incur a per-field per-document seek.
- 
MAX_RESCORE_WINDOW_SETTINGIndex setting describing the maximum size of the rescore window. Defaults toMAX_RESULT_WINDOW_SETTINGbecause they both do the same thing: control the size of the heap of hits.
- 
MAX_ADJACENCY_MATRIX_FILTERS_SETTINGIndex setting describing the maximum number of filters clauses that can be used in an adjacency_matrix aggregation. The max number of buckets produced by N filters is (N*N)/2 so a limit of 100 filters is imposed by default.
- 
DEFAULT_REFRESH_INTERVALpublic static final org.elasticsearch.core.TimeValue DEFAULT_REFRESH_INTERVAL
- 
INDEX_REFRESH_INTERVAL_SETTING
- 
INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING
- 
INDEX_FLUSH_AFTER_MERGE_THRESHOLD_SIZE_SETTINGThe minimum size of a merge that triggers a flush in order to free resources
- 
INDEX_TRANSLOG_GENERATION_THRESHOLD_SIZE_SETTINGThe maximum size of a translog generation. This is independent of the maximum size of translog operations that have not been flushed.
- 
DEFAULT_GC_DELETESpublic static final org.elasticsearch.core.TimeValue DEFAULT_GC_DELETESIndex setting to enable / disable deletes garbage collection. This setting is realtime updateable
- 
INDEX_GC_DELETES_SETTING
- 
INDEX_SOFT_DELETES_SETTINGSpecifies if the index should use soft-delete instead of hard-delete for update/delete operations. Soft-deletes is enabled by default for 7.0+ indices.
- 
INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTINGControls how many soft-deleted documents will be kept around before being merged away. Keeping more deleted documents increases the chance of operation-based recoveries and allows querying a longer history of documents. If soft-deletes is enabled, an engine by default will retain all operations up to the global checkpoint.
- 
INDEX_TRANSLOG_RETENTION_AGE_SETTINGControls how long translog files that are no longer needed for persistence reasons will be kept around before being deleted. Keeping more files is useful to increase the chance of ops based recoveries for indices with soft-deletes disabled. This setting will be ignored if soft-deletes is used in peer recoveries (default in 7.4).
- 
INDEX_TRANSLOG_RETENTION_SIZE_SETTINGControls how many translog files that are no longer needed for persistence reasons will be kept around before being deleted. Keeping more files is useful to increase the chance of ops based recoveries for indices with soft-deletes disabled. This setting will be ignored if soft-deletes is used in peer recoveries (default in 7.4).
- 
INDEX_TRANSLOG_RETENTION_TOTAL_FILES_SETTINGControls the number of translog files that are no longer needed for persistence reasons will be kept around before being deleted. This is a safeguard making sure that the translog deletion policy won't keep too many translog files especially when they're small. This setting is intentionally not registered, it is only used in tests
- 
INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTINGpublic static final Setting<org.elasticsearch.core.TimeValue> INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTINGControls the maximum length of time since a retention lease is created or renewed before it is considered expired.
- 
MAX_REFRESH_LISTENERS_PER_SHARDThe maximum number of refresh listeners allows on this shard.
- 
MAX_SLICES_PER_SCROLLThe maximum number of slices allowed in a scroll request
- 
MAX_REGEX_LENGTH_SETTINGThe maximum length of regex string allowed in a regexp query.
- 
DEFAULT_PIPELINE
- 
FINAL_PIPELINE
- 
INDEX_SEARCH_THROTTLEDMarks an index to be searched throttled. This means that never more than one shard of such an index will be searched concurrently
- 
FILE_BASED_RECOVERY_THRESHOLD_SETTINGDetermines a balance between file-based and operations-based peer recoveries. The number of operations that will be used in an operations-based peer recovery is limited to this proportion of the total number of documents in the shard (including deleted documents) on the grounds that a file-based peer recovery may copy all of the documents in the shard over to the new peer, but is significantly faster than replaying the missing operations on the peer, so once a peer falls far enough behind the primary it makes more sense to copy all the data over again instead of replaying history. Defaults to retaining history for up to 10% of the documents in the shard. This can only be changed in tests, since this setting is intentionally unregistered.
 
- 
- 
Constructor Details- 
IndexSettingsCreates a newIndexSettingsinstance. The given node settings will be merged with the settings in the metadata while index level settings will overwrite node settings.- Parameters:
- indexMetadata- the index metadata this settings object is associated with
- nodeSettings- the nodes settings this index is allocated on.
 
- 
IndexSettingspublic IndexSettings(IndexMetadata indexMetadata, Settings nodeSettings, IndexScopedSettings indexScopedSettings)Creates a newIndexSettingsinstance. The given node settings will be merged with the settings in the metadata while index level settings will overwrite node settings.- Parameters:
- indexMetadata- the index metadata this settings object is associated with
- nodeSettings- the nodes settings this index is allocated on.
 
 
- 
- 
Method Details- 
getRetentionLeaseMillispublic long getRetentionLeaseMillis()The maximum age of a retention lease before it is considered expired.- Returns:
- the maximum age
 
- 
getDefaultFieldsReturns the default search fields for this index.
- 
isQueryStringLenientpublic boolean isQueryStringLenient()Returnstrueif query string parsing should be lenient. The default isfalse
- 
isQueryStringAnalyzeWildcardpublic boolean isQueryStringAnalyzeWildcard()Returnstrueif the query string should analyze wildcards. The default isfalse
- 
isQueryStringAllowLeadingWildcardpublic boolean isQueryStringAllowLeadingWildcard()Returnstrueif the query string parser should allow leading wildcards. The default istrue
- 
isDefaultAllowUnmappedFieldspublic boolean isDefaultAllowUnmappedFields()Returnstrueif queries should be lenient about unmapped fields. The default istrue
- 
getSettingsReturns the settings for this index. These settings contain the node and index level settings where settings that are specified on both index and node level are overwritten by the index settings.
- 
getIndexReturns the index this settings object belongs to
- 
getUUIDReturns the indexes UUID
- 
hasCustomDataPathpublic boolean hasCustomDataPath()Returnstrueif the index has a custom data path
- 
customDataPathReturns the customDataPath for this index, if configured.""o.w.
- 
getIndexVersionCreatedReturns the version the index was created on.- See Also:
- IndexMetadata.SETTING_VERSION_CREATED
 
- 
getNodeNameReturns the current node name
- 
getIndexMetadataReturns the current IndexMetadata for this index
- 
getNumberOfShardspublic int getNumberOfShards()Returns the number of shards this index has.
- 
getNumberOfReplicaspublic int getNumberOfReplicas()Returns the number of replicas this index has.
- 
getNodeSettingsReturns the node settings. The settings returned fromgetSettings()are a merged version of the index settings and the node settings where node settings are overwritten by index settings.
- 
updateIndexMetadataUpdates the settings and index metadata and notifies all registered settings consumers with the new settings iff at least one setting has changed.- Returns:
- trueiff any setting has been updated otherwise- false.
 
- 
sameCompare the specified settings for equality.- Parameters:
- left- the left settings
- right- the right settings
- Returns:
- true if the settings are the same, otherwise false
 
- 
getTranslogDurabilityReturns the translog durability for this index.
- 
isWarmerEnabledpublic boolean isWarmerEnabled()Returns true if index warmers are enabled, otherwisefalse
- 
getTranslogSyncIntervalpublic org.elasticsearch.core.TimeValue getTranslogSyncInterval()Returns the translog sync interval. This is the interval in which the transaction log is asynchronously fsynced unless the transaction log is fsyncing on every operations
- 
setTranslogSyncIntervalpublic void setTranslogSyncInterval(org.elasticsearch.core.TimeValue translogSyncInterval)
- 
getRefreshIntervalpublic org.elasticsearch.core.TimeValue getRefreshInterval()Returns this interval in which the shards of this index are asynchronously refreshed.-1means async refresh is disabled.
- 
getFlushThresholdSizeReturns the transaction log threshold size when to forcefully flush the index and clear the transaction log.
- 
getFlushAfterMergeThresholdSizeReturns the merge threshold size when to forcefully flush the index and free resources.
- 
getTranslogRetentionSizeReturns the transaction log retention size which controls how much of the translog is kept around to allow for ops based recoveries
- 
getTranslogRetentionAgepublic org.elasticsearch.core.TimeValue getTranslogRetentionAge()Returns the transaction log retention age which controls the maximum age (time from creation) that translog files will be kept around
- 
getTranslogRetentionTotalFilespublic int getTranslogRetentionTotalFiles()Returns the maximum number of translog files that that no longer required for persistence should be kept for peer recovery when soft-deletes is disabled.
- 
getGenerationThresholdSizeReturns the generation threshold size. As sequence numbers can cause multiple generations to be preserved for rollback purposes, we want to keep the size of individual generations from growing too large to avoid excessive disk space consumption. Therefore, the translog is automatically rolled to a new generation when the current generation exceeds this generation threshold size.- Returns:
- the generation threshold size
 
- 
getMergeSchedulerConfigReturns theMergeSchedulerConfig
- 
getMaxResultWindowpublic int getMaxResultWindow()Returns the max result window for search requests, describing the maximum value of from + size on a query.
- 
getMaxInnerResultWindowpublic int getMaxInnerResultWindow()Returns the max result window for an individual inner hit definition or top hits aggregation.
- 
getMaxAdjacencyMatrixFiltersDeprecated.This setting will be removed in 8.0Returns the max number of filters in adjacency_matrix aggregation search requests
- 
getMaxRescoreWindowpublic int getMaxRescoreWindow()Returns the maximum rescore window for search requests.
- 
getMaxDocvalueFieldspublic int getMaxDocvalueFields()Returns the maximum number of allowed docvalue_fields to retrieve in a search request
- 
getMaxTokenCountpublic int getMaxTokenCount()Returns the maximum number of tokens that can be produced
- 
getMaxNgramDiffpublic int getMaxNgramDiff()Returns the maximum allowed difference between max and min length of ngram
- 
getMaxShingleDiffpublic int getMaxShingleDiff()Returns the maximum allowed difference between max and min shingle_size
- 
getHighlightMaxAnalyzedOffsetpublic int getHighlightMaxAnalyzedOffset()Returns the maximum number of chars that will be analyzed in a highlight request
- 
getMaxTermsCountpublic int getMaxTermsCount()Returns the maximum number of terms that can be used in a Terms Query request
- 
getMaxScriptFieldspublic int getMaxScriptFields()Returns the maximum number of allowed script_fields to retrieve in a search request
- 
getGcDeletesInMillispublic long getGcDeletesInMillis()Returns the GC deletes cycle in milliseconds.
- 
getMergePolicypublic org.apache.lucene.index.MergePolicy getMergePolicy()Returns the merge policy that should be used for this index.
- 
getValue
- 
getMaxRefreshListenerspublic int getMaxRefreshListeners()The maximum number of refresh listeners allows on this shard.
- 
getMaxSlicesPerScrollpublic int getMaxSlicesPerScroll()The maximum number of slices allowed in a scroll request.
- 
getMaxRegexLengthpublic int getMaxRegexLength()The maximum length of regex string allowed in a regexp query.
- 
getIndexSortConfigReturns the index sort config that should be used for this index.
- 
getScopedSettings
- 
isExplicitRefreshpublic boolean isExplicitRefresh()Returns true iff the refresh setting exists or in other words is explicitly set.
- 
getSearchIdleAfterpublic org.elasticsearch.core.TimeValue getSearchIdleAfter()Returns the time that an index shard becomes search idle unless it's accessed in between
- 
getDefaultPipeline
- 
setDefaultPipeline
- 
getRequiredPipeline
- 
setRequiredPipeline
- 
isSoftDeleteEnabledpublic boolean isSoftDeleteEnabled()Returnstrueif soft-delete is enabled.
- 
getSoftDeleteRetentionOperationspublic long getSoftDeleteRetentionOperations()Returns the number of extra operations (i.e. soft-deleted documents) to be kept for recoveries and history purpose.
- 
isSearchThrottledpublic boolean isSearchThrottled()Returns true if the this index should be searched throttled ie. using theThreadPool.Names.SEARCH_THROTTLEDthread-pool
- 
getMappingNestedFieldsLimitpublic long getMappingNestedFieldsLimit()
- 
getMappingNestedDocsLimitpublic long getMappingNestedDocsLimit()
- 
getMappingTotalFieldsLimitpublic long getMappingTotalFieldsLimit()
- 
getMappingDepthLimitpublic long getMappingDepthLimit()
- 
getMappingFieldNameLengthLimitpublic long getMappingFieldNameLengthLimit()
 
-