Hi,
I'm being unable to get documents that I index using Java API from the index by id. I'm using the following code to prepare the index:
IndexRequest indexRequest = new IndexRequest(myindex, mytype, myid)
.source(mysource.toString())
.routing(myrootingkey);
When I try to get a document I receive an empty found.
GET mynode.:9200/myindex/1/211535
{
"_index": "myindex",
"_type": "1",
"_id": "211535",
"found": false
}
I've also tried to manually add a document and this way I'm able to get the document.
I've searched for it and found some users with the same problem but most of them use older elasticsearch versions. I'm currently on 5.5.4 so the problem could not be the same.
I've found some information that the problem could be related to the rooting key but I couldn't find any official information about this bug/feature or how does it affect it.
Can someone explain to me what I'm doing wrong and why can't I make it work the way I'm doing it?
Thanks