DBAtlas · Database operations atlas

illegal_argument_exception_fielddata: illegal_argument_exception: Fielddata is disabled on text fields by default. Set fielddata=true on [your_field] in order to load fielddata in memory

Elasticsearch

What does it mean?

An aggregation, sort or script was attempted on an analyzed text field. These operations are disabled by default on text fields because they require memory-expensive fielddata.

Why does it happen?

An aggregation/sort was applied directly to a text field. In Elasticsearch, text is used for full-text search and keyword for exact-value aggregation/sorting; mixing the two produces this error.

How to fix it

Use the field's keyword sub-field for aggregation/sorting (e.g. "my_field.keyword"). If the field is text only, add a keyword sub-field to the mapping (multi-field) and run _reindex. Enabling fielddata on a text field (fielddata=true) is possible but not recommended due to high memory consumption and circuit breaker risk; use it only when unavoidable.

Open in DBAtlas →

More from this engine