Hi all,
I’m using OpenSearch 1.2.4
In my OpenSearch cluster, I have one index with one document.
$ curl localhost:9200/_search?pretty
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "test",
"_type" : "_doc",
"_id" : "6PPYvYgBtk-qpEG4Mocr",
"_score" : 1.0,
"_source" : {
"message" : "1c78-4bc1-af44-4e29b661822e,PDF_Document_ap1,PDF_Document_sp1,2023-06-15T05:30:22.667Z,106,91,500,Internal Server Error,HTTP_2,Https_2,Http_2,POST,v1"
}
}
]
}
}
I’m trying to search a keyword PDF_Document_ap1
using query_string.
curl -X GET "localhost:9200/test/_search?pretty" -H 'Content-Type: application/json' -d '
{
"query": {
"query_string": {
"query": "PDF_Document_ap1"
}
}
}'
And I’m getting the expected output.
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 0.2876821,
"hits" : [
{
"_index" : "test",
"_type" : "_doc",
"_id" : "6PPYvYgBtk-qpEG4Mocr",
"_score" : 0.2876821,
"_source" : {
"message" : "1c78-4bc1-af44-4e29b661822e,PDF_Document_ap1,PDF_Document_sp1,2023-06-15T05:30:22.667Z,106,91,500,Internal Server Error,HTTP_2,Https_2,Http_2,POST,v1"
}
}
]
}
}
Now, I’m trying another keyword PDF_Document_sp1
from the same field.
curl -X GET "localhost:9200/test/_search?pretty" -H 'Content-Type: application/json' -d '
{
"query": {
"query_string": {
"query": "PDF_Document_sp1"
}
}
}'
This time, it’s not returning the expected output.
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
Tried another keyword 500
from the same field.
curl -X GET "localhost:9200/test/_search?pretty" -H 'Content-Type: application/json' -d '
{
"query": {
"query_string": {
"query": "500"
}
}
}'
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
Can anyone help me in finding the cause here?
NOTE: Tried with OpenSearch 2.8.0 too. Still this issue persists.
Thanks.