Hi There,
I'm always getting empty results when i query the array objects with multi must clause as mentioned below
Index docs:
POST test/doc/1
{
"name":["Alex","Bob","Matt"],
"company":"ABC",
"city":"NY"
}
POST test/doc/2
{
"name":["Alex","Bob","John"],
"company":"XYZ",
"city":"OZ"
}
Query
POST test/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"name": {
"value": "Alex"
}
}
},
{
"match_phrase_prefix": {
"company": "ABC"
}
}
]
}
}
}
RESULT:
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
Expected result: It should return 1 hit