I have the following indexed document:
{
\"visitor\": {
\"id\":
}
}
The mapping for the document
Unless you specify the visitor.id field NOT to be analyzed, every fields are analyzed by default.
It means that "ABC" will be indexed as "abc" (lower case).
You have to use term query or term filter with string in LOWER CASE.
I hope the query below will work. ^^
{
"query": {
"filtered": {
"query": {
"match_all": {}
}
},
"filter": {
"term": { "visitor.id": "abc" }
}
}
}