Hi,
I have an index of timestamped docs in elasticsearch, and I need to
generate a list of top 10 term counts, for each day. Since I am lazy, I am
trying to do this in elasticsearch as opposed to rolling up my sleeves and
coding it myself. Following the faceting search visualization tutorial,
I've got a nice date_histogram, and from the earlier example, term counts
are easy to do. Is this any way to nest a terms facet inside a
date_histogram facet, in such a way that the terms will be only given for a
given date?
If there is no way to do this, and I'm going to code it by hand anyways,
are there benefits/is it possible for me to write an elasticsearch plugin
to do this kind of thing?
If it makes my question clearer, here's the two facets I'd like to nest
(they are in parallel below, but I ultimately want to nest them):
{
"query": {
"query_string": {
"query": "T*"
}
},
"facets": {
"published_on": {
"date_histogram": {
"field": "timestamp",
"interval": "day"
}
},
"term_count": {
"terms": {
"field": "subject"
}
}
}
}
Ideally I would like something like
{
"time": "1006300800000",
"count": 130,
"terms": [
{
"term": "re",
"count": 1302
},
{
"term": "fw",
"count": 389
}
]
}
Thanks for your help!
--paul
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.