_id is not recognized in index

when i query by
GET /testing_large_midlines_k_1/_doc/4112-2004|1838-45840835-20639-26|1-347571527
OpenSearch not able to recognize the id
{
“_index” : “testing_large_midlines_k_1”,
“_type” : “_doc”,
“_id” : “4112-2004|1838-45840835-20639-26|1-347571527”,
“found” : false
}

but when i query with
GET /testing_large_midlines_k_1/_search?
{
“query”: {
“terms”: {
“_id”: [ “4112-2004|1838-45840835-20639-26|1-347571527” ]
}
}
}

it recognizes the id :
{
“took” : 65,
“timed_out” : false,
“_shards” : {
“total” : 5,
“successful” : 5,
“skipped” : 0,
“failed” : 0
},
“hits” : {
“total” : {
“value” : 1,
“relation” : “eq”
},
“max_score” : 1.0,
“hits” : [
{
“_index” : “testing_large_midlines_k_1”,
“_type” : “_doc”,
“_id” : “4112-2004|1838-45840835-20639-26|1-347571527”,
“_score” : 1.0,

I am trying to check multiple id with _mget request, but some reason it always returns false.

Thank you.

Hello @devep,

what Version of OpenSearch are you using and where from are you attempting to get the document?

I just created a doc with the same ID on my OpenSearch 2.5 Instance and was able to retrieve it using the same query you provided using the DevTools Interface in Dashboards:

BR,
Andreas

1 Like

issue was I am using routing id while creating document and didn’t add routing in query.

if I use query like this, getting the results.

GET /testing_large_midlines_k_1/_doc/14829-20|404|1567-48795224-656-103|1952-34148457?routing=805B-HS60-Y87G-B0MX-00000-00