I recently upgrade to Elastic 5.1.1 and my unit test starts to fail. The context of the test is to put a document in the index and search it. simple. The search result does correctly return the record, however the custom "id" field has incorrect value that doesn't belong to any other document. btw, there is only 1 record in the index.
Here are the details:
This is the document that is indexed to be search. Notice the "id" is 202285124
{
"_index": "908c08cd93884c86b560848900a8968f",
"_type": "contact",
"_id": "202285124",
"_version": 1,
"_routing": "809794",
"found": true,
"_source": {
"salutation": "ed3c65cec1184a89b71fb68b6d3dd294",
"firstName": "3cb659bcac7d4bd4b27c64125671fd2a",
"lastName": "3cb659bc-ac7d-4bd4-b27c-64125671fd2a",
"background": "3a74e279-bcb5-4e0e-bb63-a9254d345161",
"emails": [],
"phones": [],
"addresses": [],
"websites": [],
"tags": [],
"customFields": [],
"dateToRemembers": [],
"visibleTo": "OWNER",
"instanceId": 809794,
"id": 202285124,
"typeName": "contact",
"typeLabel": "contact",
"title": "ed3c65cec1184a89b71fb68b6d3dd294 3cb659bcac7d4bd4b27c64125671fd2a 3cb659bc-ac7d-4bd4-b27c-64125671fd2a",
"autocomplete_title": "ed3c65cec1184a89b71fb68b6d3dd294 3cb659bcac7d4bd4b27c64125671fd2a 3cb659bc-ac7d-4bd4-b27c-64125671fd2a",
"shingle_title": "ed3c65cec1184a89b71fb68b6d3dd294 3cb659bcac7d4bd4b27c64125671fd2a 3cb659bc-ac7d-4bd4-b27c-64125671fd2a",
"dateCreated": "2017-02-14T19:49:26.303-08:00",
"dateUpdated": "2017-02-14T19:49:26.303-08:00",
"ownerUserId": 1462234
}
}
This is the search query that returns the "id" by "instanceId".
{
"stored_fields": ["id"],
"query": {
"term": {
"instanceId": 809794
}
}
}
This is the result. As you can see, the value of the "id" is 202285120 instead of 202285124.
{
"took": 7,
"timed_out": false,
"_shards": {
"total": 11,
"successful": 11,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "908c08cd93884c86b560848900a8968f",
"_type": "contact",
"_id": "202285124",
"_score": 1,
"_routing": "809794",
"fields": {
"id": [
202285120
]
}
}
]
}
}
As I mentioned, I don't have this issue with Elastic 2.3/2.4. Please advise.