_index,_uid,_type,_id 元字段
Identity meta-fields(身份的元字段)
_index field
# Example documents
curl -XPUT 'localhost:9200/index_1/my_type/1?pretty' -H 'Content-Type: application/json' -d'
{
"text": "Document in index 1"
}
'
curl -XPUT 'localhost:9200/index_2/my_type/2?refresh=true&pretty' -H 'Content-Type: application/json' -d'
{
"text": "Document in index 2"
}
'
curl -XGET 'localhost:9200/index_1,index_2/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"terms": {
"_index": ["index_1", "index_2"] # 1
}
},
"aggs": {
"indices": {
"terms": {
"field": "_index", # 2
"size": 10
}
}
},
"sort": [
{
"_index": { # 3
"order": "asc"
}
}
],
"script_fields": {
"index_name": {
"script": {
"lang": "painless",
"inline": "doc[\u0027_index\u0027]" # 4
}
}
}
}
'_type field
_uid field
_id field
Last updated