Hello.
I have encountered strange issue on ES 5.6.4 and Java 8. Multiple documents with the same _id and some with missing _version are result when using scripted_upsert to insert and merge multiple events into single document. All documents are indexed into same index and shard on the same node.
I am not sure how is this possible and any hint how to troubleshoot is appreciated. Bellow is the example of query and result.
GET /_search
{
"version": true,
"_source": ["DatabaseId", "SequenceId"],
"query": {
"bool": {
"must": [
{
"match": {
"DatabaseId": 1202
}
},
{
"match": {
"SequenceId": 239761506
}
}
]
}
}
}
{
"took": 111,
"timed_out": false,
"_shards": {
"total": 48,
"successful": 48,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 4,
"max_score": 2,
"hits": [
{
"_index": "some-index",
"_type": "message",
"_id": "1202-239761506",
"_version": 1,
"_score": 2,
"_source": {
"DatabaseId": 1202,
"SequenceId": 239761506
}
},
{
"_index": "some-index",
"_type": "message",
"_id": "1202-239761506",
"_version": 1,
"_score": 2,
"_source": {
"DatabaseId": 1202,
"SequenceId": 239761506
}
},
{
"_index": "some-index",
"_type": "message",
"_id": "1202-239761506",
"_score": 2,
"_source": {
"DatabaseId": 1202,
"SequenceId": 239761506
}
},
{
"_index": "some-index",
"_type": "message",
"_id": "1202-239761506",
"_version": 1,
"_score": 2,
"_source": {
"DatabaseId": 1202,
"SequenceId": 239761506
}
}
]
}
}
Best regards, Zvonimir