# Syntax question: query with filter

**URL:** <https://discuss.elastic.co/t/syntax-question-query-with-filter/6445>\
**Category:** Elasticsearch\
**Created:** [January 19, 2012, 9:44pm UTC](https://discuss.elastic.co/t/syntax-question-query-with-filter/6445 "2012-01-19T21:44:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_LaRosa](https://avatars.discourse-cdn.com/v4/letter/f/bc8723/32.png) [@Frank\_LaRosa](https://discuss.elastic.co/u/Frank_LaRosa)\
**Post date:** [January 19, 2012, 9:44pm UTC](https://discuss.elastic.co/t/syntax-question-query-with-filter/6445/1 "2012-01-19T21:44:52Z")

</div>

Can someone give me a curl example of a query with a filter?

It should be simple, but I can't seem to find an example anywhere.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 19, 2012, 11:12pm UTC](https://discuss.elastic.co/t/syntax-question-query-with-filter/6445/2 "2012-01-19T23:12:42Z")

</div>

Here is the filtered query:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/filtered-query.html).  
Any query in the Query DSL can be placed inside the query element of it,  
and any filter in the Query DSL can be placed inside the filter element of  
it.

When you search, you need to place the filtered query within the "query"  
element of the search request (as there are other parameters you can pass  
aside from the query, like facets and so on). So, taking the example from  
the filtered Query DSL link, here is the search request:  
[gist:1643631 · GitHub](https://gist.github.com/1643631).

On Thu, Jan 19, 2012 at 11:44 PM, Frank LaRosa [frank@studyblue.com](mailto:frank@studyblue.com) wrote:

> Can someone give me a curl example of a query with a filter?
> 
> It should be simple, but I can't seem to find an example anywhere.

---

<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, 3:42am UTC](https://discuss.elastic.co/t/syntax-question-query-with-filter/6445/3 "2017-07-06T03:42:02Z")

</div>


