Yaswanth
(Yaswanth )
February 16, 2017, 5:11pm
1
Hi,
I went through following query
{
"filtered": {
"query": {
"match": { "tweet": "full text search" }
},
"filter": {
"range": { "created": { "gte": "now-1d/d" }}
}
}
}
The filtered query is used to filter the result set .
In the above query,after finding the yesterday's documents the filtered query is used to get the documents that match the particular field(i.e.tweet).
Correct me if my understanding is wrong.
Thanks..
Yaswanth
(Yaswanth )
February 24, 2017, 5:58am
2
Since this is a post_filter after match query the filter works ..
spinscale
(Alexander Reelsen)
February 27, 2017, 8:31am
3
Hey,
a post filter is applied after the search is executed, so it only makes sense to filter out documents there, not to execute another query, because the post filter does not apply scoring - this part needs to go into your regular query. See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-post-filter.html
Unless you are using aggregrations, there is no need for the post filter.
--Alex
system
(system)
Closed
March 27, 2017, 8:32am
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.