Hi David,
You mean a query like below will fix the problem.
{"query":
{"filtered":
{"query":
{"bool":
{"should":[{"field":{"MsgData":"(royal AND
Marriage)"}}],"minimum_number_should_match":1} }
,"filter":{"range":{"CreatedAt":
{"from":"2012-7-8T00:00:00","to":"2012-7-19T23:59:59"}}}},
"facets":{"MsgData":{"terms":{"field":"MsgData","size":20}},
"facet_filter": {"range": {
"from": "2012-7-8T00:00:00",
"to": "2012-7-19T23:59:59"
}
}
}}
Please review the query and let me know if it is proper or not.
Thanks,
Pulkit Agrawal
On Mon, Jul 23, 2012 at 12:06 PM, David Pilato david@pilato.fr wrote:
Apply a filter on the facet also !
It will load only what you need to see.
HTH
David
Twitter : @dadoonet / @elasticsearchfr
Le 23 juil. 2012 à 08:33, Pulkit Agrawal pulkitdotcom@gmail.com a écrit :
Hi Shay,
Thanks for your prompt reply.
I am pasting facet query with filters on date.
{"query":
{"filtered":
{"query":
{"bool":
{"should":[{"field":{"MsgData":"(royal AND Marriage)"}}],"minimum_number_should_match":1} }
,"filter":{"range":{"CreatedAt": {"from":"2012-7-8T00:00:00","to":"2012-7-19T23:59:59"}}}},
"facets":{"MsgData":{"terms":{"field":"MsgData","size":20}}}}
This query loads the whole index irrespective of date filter range.
Please have a look on the query and let me know what's wrong with that.
Thanks,
Pulkit Agrawal
On Fri, Jul 6, 2012 at 4:12 AM, Shay Banon kimchy@gmail.com wrote:
A facet query (or a facet filter) with an additional filter do not load any field to memory, since they do not "run" on a specific field.
On Thu, Jul 5, 2012 at 1:09 PM, Pulkit Agrawal pulkitdotcom@gmail.com wrote:
Hi
I am running facet query with date range filter.
It consume the same memory whether I am running it for 7 days, or 70 days. I know facet loads the index in memory but What if I am using filter.
Does it load complete index irrespective of filtered data?
Any help would be highly appreciated.
Regards,
Pulkit Agrawal