ElasticSearch composite ID

纵饮孤独 提交于 2021-02-10 13:53:45

问题


I am using elasticsearch-py to insert data. Currently, my _id field is something like this:

_id: "{'hostname': 'xxxxx', 'day': '2016-03-22', 'service': 'xxxxxxxx'}"

My manager told me this is not a good id. I think it's ok. With ElasticSearch, can i have an id composed of several attributes ?

Eg:

_id: {
    hostname: "xxxxxx",
    day: "2016-03-22",
    service: "xxxxxxxx"
}

A second solution is to encode my string in base64 with python.

来源:https://stackoverflow.com/questions/36174474/elasticsearch-composite-id

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!