Reputation: 4859
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
Upvotes: 0
Views: 184
Reputation: 10107
There is only one query and one filter:
{"query": {"match": {"tweet": "full text search" }}}
.{"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.
Upvotes: 2