Under Elasticsearch, a document contains metadata (Metadata), in addition to data. Every time you create a piece of data, it writes to the metadata, and, of course, some of the metadata is set when you create the mapping, and the metadata plays a very big role in Elasticsearch. This article will introduce the metadata in Elasticsearch, which will be explained separately in subsequent articles.
Identity meta data (identities Meta-fields)
Identity metadata, as the name implies, uniquely identifies the document, and there are four main identity metadata in Elasticsearch:
1, _index: The index of the document, which is equivalent to the database concept in relational database, which is the place to store and index the associated data;
2, _uid: It consists of _type and _id;
3, _type: Document belongs to the mapping type, corresponds to the concept of table in relational database;
4, _id: The ID of the document, which can be automatically generated by the Elasticsearch, or can be specified by the program when writing document. When combined with _index and _type, it is possible to uniquely identify a document in Elasticsearch.
If you want to get to know Spark, Hadoop or hbase related articles in time, please pay attention to micro-credit public account: Iteblog_hadoop
Document source Meta data (Doc source meta-fields)
There are two main document source meta data:
1, _source: This field identifies the subject information of the document, which is the data we write in the Elasticsearch;
2. _size: This field stores the size of the information in the _source field, in bytes, but this requires us to install the Mapper-size plugin.
Index meta data (indexing Meta-fields)
1, _all: This field index all other fields of the value;
2, _field_names: Storing all the values in the document are Non-null field information, which is very useful in the case of Quick Find/filter value or null value;
3, _timestamp: Store the current document timestamp information, can be specified by the program, can also be automatically generated by Elasticsearch, its value will affect the deletion of the document (if the TTL mechanism is enabled);
4. _ttl: Identifies the length of time that the current document is stored, exceeding this long document will be identified as delete and then deleted by Elasticsearch.
Routing meta data (Routing meta-fields)
1, _parent: To create two mappings between the father and son relationship;
2, _routing: Custom route values, you can route a document to a specific fragment (shard).
Other meta data
_meta: application-specific meta data.