I performed below elasticsearch
query.
GET amasyn/_search
{
"query": {
"bool" : {
"filter" : {
"term": {"ordernumber": "112-9550919-9141020"}
}
}
}
}
But it does not get any hits
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
But I have a document having this ordernumber
in the index.
ordernumber
is a text field.
When I change the above query by replacing term
with match
, I get total number of hits as the no of hits for the given query.
Please explain what's happening here and how to solve this.