Reputation: 885
My elasticsearch version is 2.4,
I have issue when I use multivalue search with must clause. In the below elasticsearch query I search the query "polo tshirt" and country "us"
but It's gives the no relevant data of query "polo tshirt".
curl -XGET 'localhost:9200/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query" : {
"bool" : {
"must" : {
"match" :{
"common" : {
"_all" : {
"query" : "polo tshirt",
"minimum_should_match" : '100%'
}
}
},
"match" : { "country" : "us"}
}
}
},
"sort" : [
{"review" :{"order" :"desc"}}
]
}'
Upvotes: 0
Views: 33
Reputation: 1394
Must should be used with [].
{
"query": {
"bool": {
"must": [{
"common": {
"_all": {
"query": "polo tshirt",
"minimum_should_match": "100%"
}
}
}, {
"match": {
"country": "us"
}
}]
}
},
"sort": [{
"review": {
"order": "desc"
}
}]
}
Upvotes: 1