<>1. summary
Each document has one _id The index that uniquely identifies it , The index is indexed , So that it can be used GET API or ids query Find documents .
If not specified ,es One is also generated by default id character string .
_id Queries are often used in the following queries :term, terms,match,query_string,simple_query_string
<>2. Examples
Mapping Definition and insertion
PUT example PUT example/docs/_mapping { "properties":{ "cityId":{"type":
"long"}, "cityName":{"type": "text"}, "location":{"type": "geo_point"},
"remark":{"type": "text"} } } PUT example/docs/1 { "cityId":1,
"cityName":"xi'an", "location": { "lat":"34.45", "lon":"107.40" },
"remark":" Tourist cities in China " } PUT example/docs/2 { "cityId":2, "cityName":"Singapore",
"location": "1.05,104.60", "remark":" World ports " } PUT example/docs/3 { "cityId":3,
"cityName":"Sydney", "location": [151.12, -33.51], "remark":" Big city of Australia " }
query
# query id by 1 and 2 Document for GET example/docs/_search { "query": { "terms": { "_id": [1, 2] }
} }
Technology
Daily Recommendation