- Elasticsearch 7.0 Cookbook(Fourth Edition)
- Alberto Paro
- 190字
- 2021-06-24 14:52:03
How it works...
Every special field has its own parameters and value options, such as the following:
- _id: This allows you to index only the ID part of the document. All the ID queries will speed up using the ID value (default not indexed and not stored).
- _index: This controls whether or not the index must be stored as part of the document. It can be enabled by setting the "enabled": true parameter (enabled=false default).
- _source: This controls the storage of the document source. Storing the source is very useful, but it's a storage overhead, so it is not required. Consequently, it's better to turn it off (enabled=true default).
- _routing: This defines the shard that will store the document. It supports additional parameters, such as required (true/false). This is used to force the presence of the routing value, raising an exception if not provided.
Controlling how to index and process a document is very important and allows you to resolve issues related to complex data types.
Every special field has parameters to set particular configurations, and some of their behaviors could change in different releases of Elasticsearch.