# Issues with FILTERED query with AND filter that has multiple filter objects

**URL:** <https://discuss.elastic.co/t/issues-with-filtered-query-with-and-filter-that-has-multiple-filter-objects/11570>\
**Category:** Elasticsearch\
**Created:** [April 12, 2013, 8:31pm UTC](https://discuss.elastic.co/t/issues-with-filtered-query-with-and-filter-that-has-multiple-filter-objects/11570 "2013-04-12T20:31:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjschranz](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mjschranz](https://discuss.elastic.co/u/mjschranz)\
**Post date:** [April 12, 2013, 8:31pm UTC](https://discuss.elastic.co/t/issues-with-filtered-query-with-and-filter-that-has-multiple-filter-objects/11570/1 "2013-04-12T20:31:10Z")

</div>

First time poster, also fairly new to using elastic search.

It could be the way I am using it but in the basic sense the queries I have are like something like: "Select all records from our projects that have X tags and are made by Y author".

The structure of my query is:  
{  
"query": {  
"filtered": {  
"query": {  
"match\_all": {}  
},  
"filter": {  
"and": [  
{  
"terms": {  
"tags": ["x:tag"],  
"execution": "and"  
}  
},  
{  
"query": {  
"field": {  
"author": "dudes@stuff.org"  
}  
}  
}  
]  
}  
}  
},  
"size": 7  
}

My searches don't ever fail in retrieving data of some sort however they never have the author applied to the filter and are returning any authors they find.

Am I simply using Elasticsearch in a wrong fashion? Any insight would be great.

---

<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 6, 2017, 2:41am UTC](https://discuss.elastic.co/t/issues-with-filtered-query-with-and-filter-that-has-multiple-filter-objects/11570/2 "2017-07-06T02:41:18Z")

</div>


