AND Operator in Query string din't giving the exact Results


(JavaES) #1

HI I am using the following query ,my requirement is to hit the documents which has both oil and filter at any point in a field

sort": [
{
"PartNumber": {
"order": "asc"
}
}
],
"query" : {
"bool" : {
"must" : {
"query_string" : {
"query" : "oil AND filter"
}
}
}

but in results m getting the documents which contains only oil ,only filters and both oil & filter,but my requirement is to get only thoose documents which have oil and filter both,please me correct if m wrong.


(system) #2