<>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 id by 1 and 2 Document for GET example/docs/_search { "query": { "terms": { "_id": [1, 2] }
} }

©2019-2020 Toolsou All rights reserved,
Final review of database : Summary of comprehensive application questions Laplance operator ( Second derivative ) Simple learning of computer composition principle pyqt Button call python program _PyQt: Link button to function in program How much can you go up once you change jobs ? Today, I saw the ceiling of job hopping python in str Function usage _python in str Usage Summary of built-in functions MySQL trigger web The server nginx---linux Installation and deployment C++ Chapter V polymorphism exercises :( It's coming to an end )python Check built-in functions , How to check python Built in function