Using a combined field as id mapping in ElasticSearch

前端 未结 1 2043
心在旅途
心在旅途 2020-12-22 01:45

From this question I can see that it is possible Use existing field as id in elasticsearch

My question is, if can do similar thing but concatenating fields.

相关标签:
1条回答
  • 2020-12-22 02:36

    No you can't, you can only make the _id point to a field that's within the document, using the dot notation as well if needed (e.g. level1,level2.id).

    I'd suggest to have a field that contains the whole id in your documents, or even better to take the id out and provide it in the url, as configuring a path causes the document to be parsed when not needed.

    0 讨论(0)
提交回复
热议问题