Syntax question: query with filter


(Frank LaRosa) #1

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.


(Shay Banon) #2

Here is the filtered query:
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:
https://gist.github.com/1643631.

On Thu, Jan 19, 2012 at 11:44 PM, Frank LaRosa 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.


(system) #3