0

I've read Elastic Search documentation but I can not understand how this query works. I just want to know how is the combination of query and filter and another filter.

{
  "query": {
    "filtered": { 
      "query": {
        "match": { "tweet": "full text search" }
      },
      "filter": {
        "range": { "created": { "gte": "now - 1d / d" }}
      }
    }
  }
}

Is it possible to explain it to me a bit simpler that this page? http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html

1 Answer 1

2

There is only one query and one filter:

  1. The query part is {"query": {"match": {"tweet": "full text search" }}}.
  2. The filter part is {"filter": {"range": {"created": {......}}}}.

To insert a filter into a query, we have to use filtered query DSL.(Note that it is the past participle of "filter".) A filtered query is something like:

{"query": {"filtered": {"query": ......}, {"filter": ......} }}

Just write any query under the second "query" part, any filter under the "filter" part.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.