[Elasticsearch] es fielddata field data

Insert picture description here

1 Overview

Official website: official website

In es, text type fields use a query memory data structure called fielddata. This data structure is created when the fields are sorted, aggregated, or accessed through scripts. It is constructed by reading the entire inverted index of each segment from disk, and then storing it in java heap memory.

Fielddata is for text fields 默认时是禁用, Fielddata 会占用大量堆空间, especially when loading a large number of text fields. Once the field data is loaded into the heap, it will remain there for the life of the segment. Similarly, loading field data is an expensive process and may cause users to experience delays. This is why field data is disabled by default. If you try to sort, aggregate or script the text field, you will see the following exception:

“Fielddata is disabled on text fields by default. Set fielddata=true on [your_field_name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use s

Guess you like

Origin blog.csdn.net/qq_21383435/article/details/109454829