问题
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