I have following match query string:
curl -XGET 'my-es.com/my_indice/_search?pretty' -d '{
"size" : 10,
"query" : {
"bool" : {
"must" : [ {
"match" : {
"state" : {
"query" : ["ACTIVE", "INACTIVE"],
"type" : "boolean"
}
}
}]
}
}
}'
I guess it means "state" = "ACTIVE" or "state" = "INACTIVE"
, but actually it performs "state" = "INACTIVE"
.
Then I tried term query string:
curl -XGET 'my-es.com/my_indice/_search?pretty' -d '{
"size" : 10,
"query" : {
"bool" : {
"must" : [{
"terms" : { "state" : ["ACTIVE", "INACTIVE"] }
}]
}
}
}'
It performs "state" = "ACTIVE" or "state" = "INACTIVE"
, showing term query supports multiple OR conditions via an array.
I'm curious about why match query does not support OR condition via an array? And it does not show any syntax error.