Skip to content

Conversation

martijnvg
Copy link
Member

@martijnvg martijnvg commented Aug 7, 2025

Introduce index.mapping.index_disabled_by_default index setting to control the default of index mapping attribute of all field types except for text, match_only_text (doesn't have an index attribute). Additionally this index settings doesn't change whether meta field (e.g. _id) are indexed.

Default to false, which means all field types are indexed by default. But it can be configured to change the default of the index mapping attribute.

Note that if index is configured on a field that always takes precedence. This change just allows changing the default for mentioned field types with one simple setting change.

Initially this new index setting will be helpful experimenting with what indexing performance is with close to zero indexed data structures. However it could also be useful to configurations of Elasticsearch that with minimal indexing overhead at the expense of higher query latencies.

The index setting is currently gated behind a feature flag.

DateFieldMapper dateFieldMapper = (DateFieldMapper) mapper;
if (dateFieldMapper.fieldType().isIndexed() == false && dateFieldMapper.fieldType().hasDocValuesSkipper() == false) {
throw new IllegalArgumentException("data stream timestamp field [" + DEFAULT_PATH + "] is not indexed");
if (dateFieldMapper.fieldType().isSearchable() == false) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in a separate change.

martijnvg and others added 7 commits August 12, 2025 17:04
Introduce `index.mapping.index_disabled_by_default` index setting to control the default of `index` mapping attribute of all field types except for `text` and `match_only_text` (doesn't have `index` attribute).

Default to `false`, which means all field types are indexed by default. But it can be configured to change the default of the `index` mapping attribute.

Note that if `index` is configured on a field that always takes precedence. This change just allows changing the default for mentioned field types with one simple setting change.
@martijnvg martijnvg force-pushed the index_disabled_by_default branch from 2d8ea8f to 43008cd Compare August 12, 2025 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :StorageEngine/Mapping The storage related side of mappings v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants