Index settings
Index settings can be of two types: cluster-level settings that affect all indexes in the cluster and index-level settings that affect individual indexes.
To learn more about static and dynamic settings, see Configuring OpenSearch.
Cluster-level index settings
There are two types of cluster settings:
- Static cluster-level index settings are settings that you cannot update while the cluster is running. To update a static setting, you must stop the cluster, update the setting, and then restart the cluster.
- Dynamic cluster-level index settings are settings that you can update at any time.
Static cluster-level index settings
OpenSearch supports the following static cluster-level index settings:
-
indices.cache.cleanup_interval(Time unit): Schedules a recurring background task that cleans up expired entries from the cache at the specified interval. Default is1m(1 minute). For more information, see Index request cache. -
indices.requests.cache.size(String): The cache size as a percentage of the heap size (for example, to use 1% of the heap, specify1%). Default is1%. For more information, see Index request cache. -
indices.analysis.hunspell.dictionary.ignore_case(Static, Boolean): Controls whether Hunspell dictionary matching ignores case globally for all locales. When enabled, dictionary matching becomes case insensitive. This setting can be configured at multiple levels: node level (this setting), per-locale usingindices.analysis.hunspell.dictionary.<locale>.ignore_case(for example,indices.analysis.hunspell.dictionary.en_US.ignore_case), or in dictionary-specificsettings.ymlfiles within each dictionary directory. Per-locale and dictionary-specific settings override the global setting. Default isfalse. -
indices.analysis.hunspell.dictionary.lazy(Static, Boolean): Controls when Hunspell dictionaries are loaded. Iftrue, dictionary loading is deferred until a dictionary is actually used, reducing startup time but potentially increasing latency on first use. Iffalse, the dictionary directory is checked and all dictionaries are automatically loaded when the node starts. Default isfalse. -
indices.analysis.hunspell.dictionary.<locale>.strict_affix_parsing(Static, Boolean): Controls whether errors encountered while reading Hunspell affix rules files cause exceptions or are silently ignored. When set totrue, parsing errors in affix files will throw exceptions and prevent dictionary loading. When set tofalse, parsing errors are ignored and the dictionary continues to load. This setting can be configured per locale by replacing<locale>with the specific locale code (for example,indices.analysis.hunspell.dictionary.en_US.strict_affix_parsing). Default istrue. -
indices.memory.index_buffer_size(Static, string): Controls the amount of heap memory allocated for indexing operations across all shards on a node. Accepts either a percentage (like10%) or a byte size value (like512mb). This buffer is shared across all shards and is used to batch indexing operations before writing to disk. Default is10%of the total heap. -
indices.memory.min_index_buffer_size(Static, byte unit): Sets the absolute minimum size for the indexing buffer whenindices.memory.index_buffer_sizeis specified as a percentage. This ensures the indexing buffer never becomes too small on nodes with limited heap memory. Default is48mb. -
indices.memory.max_index_buffer_size(Static, byte unit): Sets the absolute maximum size for the indexing buffer whenindices.memory.index_buffer_sizeis specified as a percentage. This prevents the indexing buffer from consuming too much memory on nodes with large heaps. Default is unbounded (no limit). -
indices.queries.cache.size(Static, string): Controls the memory size allocated for the query cache (filter cache) on each data node. The query cache stores the results of frequently used filters to improve search performance. Accepts either a percentage value (like5%) or an exact byte value (like512mb). Default is10%of heap memory. -
indices.queries.cache.all_segments(Static, Boolean): Whether to cache queries across all segments or only frequently accessed ones. -
indices.queries.cache.count(Static, integer): The maximum number of queries to cache. -
index.query.parse.allow_unmapped_fields(Static, Boolean): Allows unmapped fields in query parsing. Default istrue. -
index.query_string.lenient(Static, Boolean): Enables lenient parsing for query strings. Default isfalse. -
index.store.stats_refresh_interval(Static, time unit): The refresh interval for index store statistics. Default is10s. -
index.store.hybrid.nio.extensions(Static, list): Expert setting. Lucene file extensions to load with NIO instead of memory mapping. Default includes common extensions likesegments_N,write.lock,si, andcfe. -
indexing_pressure.memory.limit(Static, byte size): Controls the memory limit for indexing operations to prevent memory exhaustion during heavy indexing workloads. When indexing operations exceed this threshold, they may be rejected or throttled to protect cluster stability. Accepts percentage values (like10%of heap) or byte size values (like512mb). Default is10%of the total heap memory. -
indices.query.query_string.allowLeadingWildcard(Static, Boolean): Controls whether leading wildcards are allowed in query string queries. When enabled, queries like*termor?termare permitted but may impact performance as they require scanning all terms in the index. When disabled, leading wildcard queries are rejected to improve query performance. Default istrue. -
indices.query.query_string.analyze_wildcard(Static, Boolean): Controls whether wildcard terms in query string queries are analyzed using the configured analyzer. When enabled, wildcard queries undergo analysis (tokenization, filtering) which can improve matching but may affect performance. When disabled, wildcard terms are used as-is without analysis. Default isfalse. -
indices.time_series_index.default_index_merge_policy(Static, string): Sets the default merge policy for time series indices across the cluster. This setting controls how Lucene segments are merged for time series data, which can significantly impact indexing performance and storage efficiency. Valid values includedefault,tiered, andlog_byte_size. Default isdefault.
Dynamic cluster-level index settings
OpenSearch supports the following dynamic cluster-level index settings:
-
action.auto_create_index(Boolean): Automatically creates an index if the index doesn’t already exist. Also applies any index templates that are configured. Default istrue. -
action.destructive_requires_name(Boolean): Whentrue, you must specify the index name to delete an index. You cannot delete all indexes or use wildcards. Default isfalse. -
cluster.default.index.refresh_interval(Time unit): Sets the refresh interval when theindex.refresh_intervalsetting is not provided. This setting can be useful when you want to set a default refresh interval across all indexes in a cluster and support thesearchIdlesetting. You cannot set the interval lower than thecluster.minimum.index.refresh_intervalsetting. -
cluster.minimum.index.refresh_interval(Time unit): Sets the minimum refresh interval and applies it to all indexes in the cluster. Thecluster.default.index.refresh_intervalsetting should be higher than this setting’s value. If, during index creation, theindex.refresh_intervalsetting is lower than the minimum set, index creation fails. -
cluster.indices.close.enable(Boolean): Enables closing of open indexes in OpenSearch. Default istrue. -
indices.recovery.max_bytes_per_sec(String): Limits the total inbound and outbound recovery traffic for each node. This applies to peer recoveries and snapshot recoveries. Default is40mb. If you set the recovery traffic value to less than or equal to0mb, rate limiting will be disabled, which causes recovery data to be transferred at the highest possible rate. -
indices.recovery.max_concurrent_file_chunks(Integer): The number of file chunks sent in parallel for each recovery operation. Default is2. -
indices.recovery.max_concurrent_operations(Integer): The number of operations sent in parallel for each recovery. Default is1. -
indices.recovery.max_concurrent_remote_store_streams(Integer): The number of streams to the remote repository that can be opened in parallel when recovering a remote store index. Default is20. -
indices.replication.max_bytes_per_sec(String): Limits the total inbound and outbound replication traffic for each node. If a value is not specified in the configured value theindices.recovery.max_bytes_per_secsetting is used, which defaults to 40 Mb. If you set the replication traffic value to less than or equal to 0 Mb, rate limiting is disabled, which causes replication data to be transferred at the highest possible rate. -
indices.fielddata.cache.size(String): The maximum size of the field data cache. May be specified as an absolute value (for example,8GB) or a percentage of the node heap (for example,50%). This setting is dynamic. If you don’t specify this setting, the maximum size is35%. This value should be smaller than theindices.breaker.fielddata.limit. For more information, see Field data circuit breaker. -
indices.query.bool.max_clause_count(Integer): Defines the maximum product of fields and terms that can be searched simultaneously. Before OpenSearch 2.16, a cluster restart was required in order to apply this static setting. Now dynamic, existing search thread pools may use the old static value initially, causingTooManyClausesexceptions. New thread pools use the updated value. Default is1024. cluster.remote_store.index.path.type(String): The path strategy for the data stored in the remote store. This setting is effective only for remote-store-enabled clusters. This setting supports the following values:fixed: Stores the data in path structure<repository_base_path>/<index_uuid>/<shard_id>/.hashed_prefix: Stores the data in path structurehash(<shard-data-idenitifer>)/<repository_base_path>/<index_uuid>/<shard_id>/.hashed_infix: Stores the data in path structure<repository_base_path>/hash(<shard-data-idenitifer>)/<index_uuid>/<shard_id>/.shard-data-idenitiferis characterized by the index_uuid, shard_id, kind of data (translog, segments), and type of data (data, metadata, lock_files). Default isfixed.
cluster.remote_store.index.path.hash_algorithm(String): The hash function used to derive the hash value whencluster.remote_store.index.path.typeis set tohashed_prefixorhashed_infix. This setting is effective only for remote-store-enabled clusters. This setting supports the following values:fnv_1a_base64: Uses the FNV1a hash function and generates a url-safe 20-bit base64-encoded hash value.fnv_1a_composite_1: Uses the FNV1a hash function and generates a custom encoded hash value that scales well with most remote store options. The FNV1a function generates 64-bit value. The custom encoding uses the most significant 6 bits to create a url-safe base64 character and the next 14 bits to create a binary string. Default isfnv_1a_composite_1.
-
cluster.remote_store.translog.transfer_timeout(Time unit): Controls the timeout value while uploading translog and checkpoint files during a sync to the remote store. This setting is applicable only for remote-store-enabled clusters. Default is30s. -
cluster.remote_store.index.segment_metadata.retention.max_count(Integer): Controls the minimum number of metadata files to keep in the segment repository on a remote store. A value below1disables the deletion of stale segment metadata files. Default is10. -
cluster.remote_store.segment.transfer_timeout(Time unit): Controls the maximum amount of time to wait for all new segments to update after refresh to the remote store. If the upload does not complete within a specified amount of time, it throws aSegmentUploadFailedExceptionerror. Default is30m. It has a minimum constraint of10m. -
cluster.remote_store.translog.path.prefix(String): Controls the fixed path prefix for translog data on a remote-store-enabled cluster. This setting only applies when thecluster.remote_store.index.path.typesetting is eitherHASHED_PREFIXorHASHED_INFIX. Default is an empty string,"". -
cluster.remote_store.segments.path.prefix(String): Controls the fixed path prefix for segment data on a remote-store-enabled cluster. This setting only applies when thecluster.remote_store.index.path.typesetting is eitherHASHED_PREFIXorHASHED_INFIX. Default is an empty string,"". -
cluster.snapshot.shard.path.prefix(String): Controls the fixed path prefix for snapshot shard-level blobs. This setting only applies when the repositoryshard_path_typesetting is eitherHASHED_PREFIXorHASHED_INFIX. Default is an empty string,"". -
cluster.default_number_of_replicas(Integer): Controls the default number of replicas for indexes in the cluster. The index-levelindex.number_of_replicassetting defaults to this value if not configured. Default is1. -
cluster.thread_pool.<fixed-threadpool>.size(Integer): Controls the sizes of both the fixed and resizable queue thread pools. Overrides the defaults provided inopensearch.yml. -
cluster.thread_pool.<scaling-threadpool>.max(Integer): Sets the maximum size of the scaling thread pool. Overrides the default provided inopensearch.yml. cluster.thread_pool.<scaling-threadpool>.core(Integer): Specifies the core size of the scaling thread pool. Overrides the default provided inopensearch.yml.
Before tuning thread pool settings dynamically, note that these are expert-level settings that can potentially destabilize your cluster. Modifying thread pool settings applies the same thread pool size to all nodes, so it’s not recommended for clusters with different hardware for the same roles. Similarly, avoid tuning thread pools shared by both data nodes and cluster manager nodes. After making these changes, we recommend monitoring your cluster to ensure that it remains stable and performs as expected.
Updating dynamic cluster settings
To learn how to update dynamic settings, see Updating cluster settings using the API.
Index-level index settings
You can specify index settings at index creation. There are two types of index settings:
- Static index-level index settings are settings that you cannot update while the index is open. To update a static setting, you must close the index, update the setting, and then reopen the index.
- Dynamic index-level index settings are settings that you can update at any time.
Specifying a setting when creating an index
When creating an index, you can specify its static or dynamic settings as follows:
PUT /testindex
{
"settings": {
"index.number_of_shards": 1,
"index.number_of_replicas": 2
}
}
Static index-level index settings
OpenSearch supports the following static index-level index settings:
-
index.number_of_shards(Integer): The number of primary shards in the index. Default is 1. -
index.number_of_routing_shards(Integer): The number of routing shards used to split an index. -
index.shard.check_on_startup(Boolean): Whether the index’s shards should be checked for corruption. Available options arefalse(do not check for corruption),checksum(check for physical corruption), andtrue(check for both physical and logical corruption). Default isfalse. -
index.codec(String): Determines how the index’s stored fields are compressed and stored on disk. This setting impacts the size of the index shards and the performance of the index operations.Valid values are:
defaultbest_compressionzstd(OpenSearch 2.9 and later)zstd_no_dict(OpenSearch 2.9 and later)qat_lz4(OpenSearch 2.14 and later, on supported systems)qat_deflate(OpenSearch 2.14 and later, on supported systems)qat_zstd(OpenSearch 2.19.3 and later, on supported systems)
For zstd, zstd_no_dict, qat_lz4, qat_deflate, and qat_zstd, you can specify the compression level in the index.codec.compression_level setting. For more information, see Index codec settings. Optional. Default is default.
-
index.codec.compression_level(Integer): The compression level setting provides a trade-off between compression ratio and speed. A higher compression level results in a higher compression ratio (smaller storage size), but slower compression and decompression speeds lead to higher indexing and search latencies. This setting can only be specified ifindex.codecis set tozstdorzstd_no_dictin OpenSearch 2.9 and later;qat_lz4orqat_deflatein OpenSearch 2.14 and later; orqat_zstdin OpenSearch 2.19.3 and later. Valid values are integers in the[1, 6]range. For more information, see Index codec settings. Optional. Default is3. -
index.codec.qatmode(String): The hardware acceleration mode used for theqat_lz4,qat_deflate, andqat_zstdcompression codecs. Valid values areautoandhardware. For more information, see Index codec settings. Optional. Default isauto(the recommended setting). -
index.routing_partition_size(Integer): The number of shards a custom routing value can go to. Routing helps an imbalanced cluster by relocating values to a subset of shards rather than a single shard. To enable routing, set this value to greater than 1 but less thanindex.number_of_shards. Default is 1. -
index.soft_deletes.retention_lease.period(Time unit): The maximum amount of time to retain a shard’s history of operations. Default is12h.
-
index.sort.field(String): Specifies the field used to sort documents at index time. The default sort order isasc(ascending). To change the order, set theindex.sort.orderparameter. -
index.sort.order(String): Specifies the document sort order at index time. Valid values areasc(ascending) anddesc(descending). Default isasc. This setting requiresindex.sort.fieldto also be set. -
index.sort.mode(String): Controls how multi-valued fields are handled during sorting. Valid values aremin(uses the lowest value) andmax(uses the highest value). -
index.sort.missing(String): Determines how documents missing the sort field are handled. Valid values are_last(places documents without the field at the end) and_first(places documents without the field at the beginning). -
index.load_fixed_bitset_filters_eagerly(Boolean): Whether OpenSearch should preload cached filters. Available options aretrueandfalse. Default istrue. -
index.hidden(Boolean): Whether the index should be hidden. Hidden indexes are not returned as part of queries that have wildcards. Available options aretrueandfalse. Default isfalse. -
index.merge.policy(String): This setting controls the merge policy for the Lucene segments. The available options aretieredandlog_byte_size. The default istiered, but for time-series data, such as log events, we recommend that you use thelog_byte_sizemerge policy, which can improve query performance when conducting range queries on the@timestampfield. We recommend that you not change the merge policy of an existing index. Instead, configure this setting when creating a new index.
Tiered merge policy settings
When using the tiered merge policy (the default), the following settings control merge behavior:
-
index.merge.policy.max_merge_at_once(Dynamic, integer): Sets the maximum number of segments to be merged at a time during normal merging operations. Higher values can reduce the total number of merges but require more memory and I/O resources during each merge operation. This setting must be at least 2 and should typically be less than or equal tosegments_per_tierto avoid forcing too many merges. Default is30. Minimum is2. -
index.merge.policy.segments_per_tier(Dynamic, double): Controls the allowed number of segments per tier in the tiered merge policy. Smaller values result in more merging but fewer segments, which can improve search performance at the cost of increased indexing overhead. This value should be greater than or equal tomax_merge_at_onceto prevent excessive merging. Default is10.0. Minimum is2.0. -
index.merge.policy.reclaim_deletes_weight(Dynamic, double): Controls how aggressively the merge policy reclaims deleted documents. Higher values make the merge policy prioritize merging segments with many deleted documents, which can help reclaim disk space more quickly but may increase merge overhead. A value of0.0disables this behavior entirely. Default is2.0. Minimum is0.0.
Log byte size merge policy settings
When using the log_byte_size merge policy, the following settings control merge behavior:
-
index.merge.log_byte_size_policy.merge_factor(Dynamic, integer): Controls how many segments are merged at once during normal merging operations. Higher values lead to fewer, larger segments, which can improve search performance but use more resources during merging. Default is10. Minimum is2. -
index.merge.log_byte_size_policy.min_merge(Dynamic, byte unit): Sets the minimum size threshold for segment merging. Segments smaller than this size are more aggressively merged. Smaller values lead to fewer small segments but more merge operations. Default is2MB. -
index.merge.log_byte_size_policy.max_merge_segment(Dynamic, byte unit): Controls the maximum size of segments created during normal merge operations. Larger segments improve query performance but require more memory and can increase merge times. Default is5GB. -
index.merge.log_byte_size_policy.max_merge_segment_forced_merge(Dynamic, byte unit): Sets the maximum segment size when performing forced merge operations (such as during index optimization). This allows forced merges to create larger segments than normal merges. Default is unlimited.
Merge scheduler settings
The following settings control the merge scheduler, which determines how merge operations are executed:
-
index.merge.scheduler.max_thread_count(Dynamic, integer): Sets the maximum number of threads on a single shard that may be merging at once. This controls the concurrency of merge operations within each shard. Higher values can improve merge performance on systems with SSDs and multiple CPU cores, but may increase resource usage. If your index is on spinning platter drives, decrease this to 1. Default isMath.max(1, Math.min(4, node.processors / 2)), which works well for solid-state drives. Minimum is1. -
index.merge.scheduler.auto_throttle(Dynamic, Boolean): Enables automatic throttling of merge operations to prevent them from overwhelming the system. When enabled, OpenSearch automatically adjusts merge I/O rates based on incoming indexing load. Default istrue. -
index.merge_on_flush.enabled(Boolean): This setting controls Apache Lucene’s merge-on-refresh feature that aims to reduce the number of segments by performing merges on refresh (or in terms of OpenSearch, on flush). Default istrue. -
index.merge_on_flush.max_full_flush_merge_wait_time(Time unit): This setting sets the amount of time to wait for merges whenindex.merge_on_flush.enabledis enabled. Default is10s. -
index.merge_on_flush.policy(defaultmerge-on-flush): This setting controls which merge policy should be used when index.merge_on_flush.enabledis enabled. Default isdefault. -
index.check_pending_flush.enabled(Boolean): This setting controls the Apache LucenecheckPendingFlushOnUpdateindex writer setting, which specifies whether an indexing thread should check for pending flushes on an update in order to flush indexing buffers to disk. Default istrue. -
index.use_compound_file(Boolean): This setting controls the Apache LuceneuseCompoundFileindex writer settings, which specifies whether newly written segment files will be packed into a compound file. Default istrue. -
index.append_only.enabled(Boolean): Set totrueto prevent any updates to documents in the index. Default isfalse. -
index.derived_source.enabled(Boolean): Set totrueto dynamically generate the source without explicitly storing the_sourcefield, which can optimize storage. Default isfalse. For more information, see Derived source. -
index.mapping.ignore_malformed(Boolean): Controls whether malformed fields are ignored during document parsing. When enabled, documents with malformed field values are indexed successfully, with the malformed fields either ignored or set to null depending on the field type. When disabled, documents with malformed fields are rejected. This setting provides a default behavior that can be overridden at the field level. Default isfalse. -
index.append_only_enabled(Final, Boolean): Enables append-only mode for the index. When set totrue, the index only allows append operations (new documents) and does not permit updates or deletes of existing documents. This setting is final and cannot be changed after index creation. Append-only mode can improve indexing performance and simplify data management for use cases that only require data ingestion. Default isfalse. -
index.soft_deletes.enabled(Final, Boolean): Enables soft deletes for the index. When enabled, deleted documents are marked as deleted rather than immediately removed, allowing for better recovery and replication performance. This setting is mandatory for OpenSearch 2.0+ indices and is enabled by default for legacy indices. Once set, this setting cannot be changed after index creation. Default istrue. -
index.store.preload(Static, list): Specifies which file extensions should be preloaded into the filesystem cache when the index is opened. This setting only works with the mmap directory implementation and provides best-effort caching. Preloading files can improve search performance by reducing disk I/O, but it consumes more memory. Common extensions includenvd(norms),dvd(doc values), andtim(terms index). Default is[](empty list). index.bulk.adaptive_shard_selection.enabled(Boolean): Set totrueto enable adaptive shard selection for bulk operations so that a single shard is chosen for append-only indexes. Default isfalse. For more information, see Adaptive shard selection for bulk indexing.
Updating a static index setting
You can update a static index setting only on a closed index. The following example demonstrates updating the index codec setting.
First, close an index:
POST /testindex/_close
Then update the settings by sending a request to the _settings endpoint:
PUT /testindex/_settings
{
"index": {
"codec": "zstd_no_dict",
"codec.compression_level": 3
}
}
Last, reopen the index to enable read and write operations:
POST /testindex/_open
For more information about updating settings, including supported query parameters, see Update settings.
Dynamic index-level index settings
OpenSearch supports the following dynamic index-level index settings:
-
index.number_of_replicas(Integer): The number of replica shards each primary shard should have. For example, if you have 4 primary shards and setindex.number_of_replicasto 3, the index has 12 replica shards. If not set, defaults tocluster.default_number_of_replicas(which is1by default). -
index.number_of_search_replicas(Integer): The number of search replica shards that each primary shard should have. For example, if you have 4 primary shards and setindex.number_of_search_replicasto 3, the index has 12 search replica shards. Default is0. -
index.auto_expand_replicas(String): Whether the cluster should automatically add replica shards based on the number of data nodes. Specify a lower bound and upper limit (for example, 0–9) orallfor the upper limit. For example, if you have 5 data nodes and setindex.auto_expand_replicasto 0–3, then the cluster does not automatically add another replica shard. However, if you set this value to0-alland add 2 more nodes for a total of 7, the cluster will expand to now have 6 replica shards. Default is disabled. -
index.auto_expand_search_replicas(String): Controls whether the cluster automatically adjusts the number of search replica shards based on the number of available search nodes. Specify the value as a range with a lower and upper bound, for example,0-3or0-all. If you don’t specify a value, this feature is disabled.For example, if you have 5 data nodes and set
index.auto_expand_search_replicasto0-3, the index can have up to 3 search replicas and the cluster does not automatically add another search replica shard. However, if you setindex.auto_expand_search_replicasto0-alland add 2 more nodes, for a total of 7, the cluster will expand to now have 7 search replica shards. This setting is disabled by default. -
index.blocks.write(Boolean): Specifies whether the index is read-only. Setting totrueblocks all write requests and makes the index read-only. Default isfalse. -
index.search.idle.after(Time unit): The amount of time a shard should wait for a search or get request until it goes idle. Default is30s. -
index.search.default_pipeline(String): The name of the search pipeline that is used if no pipeline is explicitly set when searching an index. If a default pipeline is set and the pipeline doesn’t exist, then the index requests fail. Use the pipeline name_noneto specify no default search pipeline. For more information, see Default search pipeline. -
index.refresh_interval(Time unit): How often the index should refresh, which publishes its most recent changes and makes them available for searching. Can be set to-1to disable refreshing. Default is1s. -
index.max_result_window(Integer): The maximum value offrom+sizefor searches of the index.fromis the starting index to search from, andsizeis the number of results to return. Default is 10000. -
index.max_inner_result_window(Integer): The maximum value offrom+sizethat specifies the number of returned nested search hits and most relevant document aggregated during the query.fromis the starting index to search from, andsizeis the number of top hits to return. Default is 100. -
index.max_rescore_window(Integer): The maximum value ofwindow_sizefor rescore requests to the index. Rescore requests reorder the index’s documents and return a new score, which can be more precise. Default is the same asindex.max_inner_result_windowor 10000 by default. -
index.max_docvalue_fields_search(Integer): The maximum number ofdocvalue_fieldsallowed in a query. Default is 100. -
index.max_script_fields(Integer): The maximum number ofscript_fieldsallowed in a query. Default is 32. -
index.max_ngram_diff(Integer): The maximum difference betweenmin_gramandmax_gramvalues for theNGramTokenizerandNGramTokenFilter. Default is 1. -
index.max_shingle_diff(Integer): The maximum difference betweenmax_shingle_sizeandmin_shingle_sizeto feed into theshingletoken filter. Default is 3. -
index.max_refresh_listeners(Integer): The maximum number of refresh listeners each shard is allowed to have. -
index.analyze.max_token_count(Integer): The maximum number of tokens that can be returned from the_analyzeAPI operation. Default is 10000. -
index.highlight.max_analyzed_offset(Integer): The number of characters a highlight request can analyze. Default is 1000000. -
index.max_terms_count(Integer): The maximum number of terms a terms query can accept. Default is 65536. -
index.max_regex_length(Integer): The maximum character length of regex that can be in a regexp query. Default is 1000. -
index.query.default_field(List): A field or list of fields that OpenSearch uses in queries in case a field isn’t specified in the parameters. -
index.query.max_nested_depth(Integer): The maximum number of nesting levels fornestedqueries. Default is20. Minimum is1(singlenestedquery). -
index.requests.cache.enable(Boolean): Enables or disables the index request cache. Default istrue. For more information, see Index request cache. -
index.routing.allocation.enable(String): Specifies options for the index’s shard allocation. Available options areall(allow allocation for all shards),primaries(allow allocation only for primary shards),new_primaries(allow allocation only for new primary shards), andnone(do not allow allocation). Default isall. -
index.routing.rebalance.enable(String): Enables shard rebalancing for the index. Available options areall(allow rebalancing for all shards),primaries(allow rebalancing only for primary shards),replicas(allow rebalancing only for replicas), andnone(do not allow rebalancing). Default isall. -
index.gc_deletes(Time unit): The amount of time to retain a deleted document’s version number. Default is60s. -
index.default_pipeline(String): The default ingest node pipeline for the index. If the default pipeline is set and the pipeline does not exist, then index requests fail. The pipeline name_nonespecifies that the index does not have an ingest pipeline. -
index.final_pipeline(String): The final ingest node pipeline for the index. If the final pipeline is set and the pipeline does not exist, then index requests fail. The pipeline name_nonespecifies that the index does not have an ingest pipeline. -
index.optimize_doc_id_lookup.fuzzy_set.enabled(Boolean): This setting controls whetherfuzzy_setshould be enabled in order to optimize document ID lookups in index or search calls by using an additional data structure, in this case, the Bloom filter data structure. Enabling this setting improves performance for upsert and search operations that rely on document IDs by creating a new data structure (Bloom filter). The Bloom filter allows for the handling of negative cases (that is, IDs being absent in the existing index) through faster off-heap lookups. Note that creating a Bloom filter requires additional heap usage during indexing time. Default isfalse. -
index.optimize_doc_id_lookup.fuzzy_set.false_positive_probability(Double): Sets the false-positive probability for the underlyingfuzzy_set(that is, the Bloom filter). A lower false-positive probability ensures higher throughput for upsert and get operations but results in increased storage and memory use. Allowed values range between0.01and0.50. Default is0.20. -
index.routing.allocation.total_shards_per_node(Integer): The maximum combined total number of primary and replica shards from a single index that can be allocated to a single node. Default is-1(unlimited). Helps control per-index shard distribution across nodes by limiting the number of shards per node. Use with caution because shards from this index may remain unallocated if nodes reach their configured limits. -
index.routing.allocation.total_primary_shards_per_node(Integer): The maximum number of primary shards from a single index that can be allocated to a single node. This setting is applicable only for remote-backed clusters. Default is-1(unlimited). Helps control per-index primary shard distribution across nodes by limiting the number of primary shards per node. Use with caution because primary shards from this index may remain unallocated if nodes reach their configured limits. -
index.derived_source.translog.enabled(Boolean): Controls how documents are read from the translog for an index with derived source enabled. Defaults to theindex.derived_source.enabledvalue. For more information, see Derived source. -
index.flush_after_merge(Dynamic, byte unit): The size (in bytes) after which to flush after merge operations. Default is512MB. -
index.max_slices_per_pit(Dynamic, integer): The maximum number of slices per point-in-time search. Default is1024. -
index.unreferenced_file_cleanup.enabled(Dynamic, Boolean): Enables cleanup of unreferenced index files. Default istrue. -
index.warmer.enabled(Dynamic, Boolean): Enables index warmer functionality. Default istrue. -
index.allocation.max_retries(Dynamic, integer): The maximum number of times shards can be retried for allocation before giving up. This setting prevents infinite allocation retry loops when shards cannot be allocated due to resource constraints or other issues. Default is5. Range is0toInteger.MAX_VALUE. -
index.max_adjacency_matrix_filters(Dynamic, integer): The maximum number of adjacency matrix filters allowed in aggregations. Adjacency matrix aggregations analyze relationships between different filters. Higher values allow more complex relationship analysis but consume more memory. Default is100. Minimum is2. -
index.max_slices_per_scroll(Dynamic, integer): The maximum number of slices allowed per scroll request for this index. Slicing allows scroll operations to be parallelized across multiple slices for better performance. Higher values enable more parallelization but consume more resources. Default is1024. Minimum is1. -
index.optimize_auto_generated_id(Dynamic, Boolean): Enables optimization for documents with auto-generated IDs. When enabled, OpenSearch can optimize indexing performance for documents that use automatically generated document IDs rather than custom IDs. This optimization may not apply immediately and depends on the engine state. Default istrue. -
index.search.throttled(Dynamic, Boolean): Marks the index for throttled searching. When enabled, search operations on this index are limited to use only one shard concurrently, which can help reduce resource usage for less critical indexes. This setting affects search performance by serializing shard access. Default isfalse. -
index.translog.generation_threshold_size(Dynamic, byte unit): The size threshold that triggers the creation of a new translog generation. When the current translog generation reaches this size, OpenSearch creates a new generation file. Larger values can improve indexing performance by reducing the frequency of generation rollovers but may increase recovery time. Default is64MB. Minimum is64KB. -
index.translog.sync_interval(Dynamic, time unit): The frequency at which the translog is fsynced to disk and committed. More frequent syncing provides better durability guarantees but may impact indexing performance. Less frequent syncing improves performance but increases the risk of data loss during failures. Default is5s. Minimum is100ms. -
index.translog.retention.age(Dynamic, time unit): The maximum age of translog files to retain for Ops-based recovery. Translog files older than this setting are deleted during translog cleanup. This setting works in conjunction withindex.translog.retention.sizeto control translog retention. Default is12h. -
index.translog.retention.size(Dynamic, byte unit): The maximum total size of translog files to retain for Ops-based recovery. When the total size of translog files exceeds this threshold, older files are deleted during cleanup. This setting works in conjunction withindex.translog.retention.ageto control translog retention. Default is512MB. -
index.translog.retention.total_files(Integer): The maximum number of translog files to retain. This setting controls the number of translog files kept on disk regardless of their age or size, which can be useful for controlling storage usage and recovery capabilities. Default is100. -
index.soft_deletes.retention.operations(Long): The maximum number of soft-deleted operations to retain in the index. Soft deletes allow for efficient replication and point-in-time recovery by marking documents as deleted rather than immediately removed. This setting controls how many soft-deleted operations are preserved before they are eligible for cleanup. Default is0(unlimited retention). -
index.remote_store.enabled(Boolean): Enables remote store functionality for the index. When enabled, the index’s segments and translog data are stored in a remote repository in addition to local storage. This provides data durability and enables features like point-in-time recovery from remote snapshots. This setting must be configured during index creation and cannot be changed afterward. Default isfalse. -
index.remote_store.segment.repository(String): Specifies the repository name for storing index segments when remote store is enabled. The repository must be configured at the cluster level before being used for remote segment storage. This setting is required whenindex.remote_store.enabledistrueand determines where segment files are stored remotely. -
index.remote_store.translog.repository(String): Specifies the repository name for storing translog data when remote store is enabled. The repository must be configured at the cluster level before being used for remote translog storage. This setting is required whenindex.remote_store.enabledistrueand determines where translog files are stored remotely. -
index.remote_store.translog.keep_extra_gen(Dynamic, integer): The number of extra translog generations to keep in the remote store beyond the minimum required for recovery. Higher values provide more recovery options but consume more storage space. This setting helps balance between storage costs and recovery flexibility in remote store configurations. Default is0. -
index.remote_store.translog.buffer_interval(Dynamic, time unit): The interval at which translog data is buffered before being uploaded to the remote store. More frequent uploads provide better durability but may impact performance. This setting works in conjunction with the cluster-levelcluster.remote_store.translog.buffer_intervalsetting, with the index-level setting taking precedence. Default inherits from cluster setting. -
index.blocks.read_only(Dynamic, Boolean): When set totrue, makes the index read-only by blocking all write operations including indexing, updates, and deletes. Read operations like searches and gets continue to work normally. This setting is useful for temporarily preventing writes during maintenance or troubleshooting. Default isfalse. index.replication.type(Static, string): Defines the replication strategy used for the index. Valid values are:DOCUMENT: Traditional document-based replication where individual documents are replicatedSEGMENT: Segment-based replication for improved performance and reduced network overhead This setting must be configured during index creation and cannot be changed afterward. Default isDOCUMENT.
index.routing.allocation.require.temp(Dynamic, string): Requires shards for this index to be allocated only to nodes with the specified temperature attribute. This setting is used for hot-warm architectures where different node types handle different data temperatures. The value should match a node attribute likehot,warm, orcold. No default value - when not set, shards can be allocated to any eligible node.
index.periodic_flush_interval(Time unit): Triggers a flush periodically at the configured interval, storing all in-memory operations to segments on disk. OpenSearch automatically performs flush operations in the background based on conditions such as transaction log size. Default is-1, which disables periodic flush. For pull-based ingestion indexes, the default is10m. See Pull-based ingestion. You can configure this setting if your workload requires predictable, time-based flush intervals.
Index slow log settings
OpenSearch supports the following dynamic index-level slow log settings for monitoring search and indexing performance:
Indexing slow log settings
-
index.indexing.slowlog.threshold.index.warn(Dynamic, time unit): Sets the time threshold for logging slow indexing operations at the WARN level. Indexing operations that take longer than this threshold are logged as warnings. Default is-1(disabled). -
index.indexing.slowlog.threshold.index.info(Dynamic, time unit): Sets the time threshold for logging slow indexing operations at the INFO level. Indexing operations that take longer than this threshold are logged for informational purposes. Default is-1(disabled). -
index.indexing.slowlog.threshold.index.debug(Dynamic, time unit): Sets the time threshold for logging slow indexing operations at the DEBUG level. This provides detailed debugging information for indexing performance analysis. Default is-1(disabled). -
index.indexing.slowlog.threshold.index.trace(Dynamic, time unit): Sets the time threshold for logging slow indexing operations at the TRACE level. This provides the most detailed logging for troubleshooting indexing performance issues. Default is-1(disabled).
Search slow log settings
-
index.search.slowlog.threshold.query.warn(Dynamic, time unit): Sets the time threshold for logging slow search query operations at the WARN level. Query operations that take longer than this threshold are logged as warnings. Default is-1(disabled). -
index.search.slowlog.threshold.query.info(Dynamic, time unit): Sets the time threshold for logging slow search query operations at the INFO level. Query operations that take longer than this threshold are logged for informational purposes. Default is-1(disabled). -
index.search.slowlog.threshold.query.debug(Dynamic, time unit): Sets the time threshold for logging slow search query operations at the DEBUG level. This provides detailed debugging information for query performance analysis. Default is-1(disabled). -
index.search.slowlog.threshold.query.trace(Dynamic, time unit): Sets the time threshold for logging slow search query operations at the TRACE level. This provides the most detailed logging for troubleshooting query performance issues. Default is-1(disabled). -
index.search.slowlog.threshold.fetch.warn(Dynamic, time unit): Sets the time threshold for logging slow search fetch operations at the WARN level. Fetch operations that take longer than this threshold are logged as warnings. Default is-1(disabled). -
index.search.slowlog.threshold.fetch.info(Dynamic, time unit): Sets the time threshold for logging slow search fetch operations at the INFO level. Fetch operations that take longer than this threshold are logged for informational purposes. Default is-1(disabled). -
index.search.slowlog.threshold.fetch.debug(Dynamic, time unit): Sets the time threshold for logging slow search fetch operations at the DEBUG level. This provides detailed debugging information for fetch performance analysis. Default is-1(disabled). -
index.search.slowlog.threshold.fetch.trace(Dynamic, time unit): Sets the time threshold for logging slow search fetch operations at the TRACE level. This provides the most detailed logging for troubleshooting fetch performance issues. Default is-1(disabled).
Updating a dynamic index setting
You can update a dynamic index setting at any time through the API. For example, to update the refresh interval, use the following request:
PUT /testindex/_settings
{
"index": {
"refresh_interval": "2s"
}
}
For more information about updating settings, including supported query parameters, see Update settings.