Sometimes when we are working with our mapping, it is required to store some additional data to be used for display purpose, ORM facilities, permissions, or simply to track them in the mapping.
Elasticsearch allows storing every kind of JSON data we want in the mapping with the special field _meta
.
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
The
_meta
mapping field can be populated with any data we want. Consider the following example:{ "order": { "_meta": { "attr1": ["value1", "value2"], "attr2": { "attr3": "value3" } } } }