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

**URL:** <https://discuss.elastic.co/t/and-operator-in-query-string-dint-giving-the-exact-results/64755>\
**Category:** Elasticsearch\
**Created:** [November 2, 2016, 5:54pm UTC](https://discuss.elastic.co/t/and-operator-in-query-string-dint-giving-the-exact-results/64755 "2016-11-02T17:54:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad\_kp](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@prasad\_kp](https://discuss.elastic.co/u/prasad_kp)\
**Post date:** [November 2, 2016, 5:54pm UTC](https://discuss.elastic.co/t/and-operator-in-query-string-dint-giving-the-exact-results/64755/1 "2016-11-02T17:54:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:07pm UTC](https://discuss.elastic.co/t/and-operator-in-query-string-dint-giving-the-exact-results/64755/2 "2017-07-05T22:07:16Z")

</div>


