Thanks Vineeth.
Unfortunately it doesn't return any results in the aggregations result.
Input query:
GET _search
{
"aggregations": {
"aggs": {
"terms": {
"field": "_index"
}
}
}
}
Result JSON showing 26K hits (correct), but no index aggregations:
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 57,
"successful": 57,
"failed": 0
},
"hits": {
"total": 26622,
"max_score": 1,
"hits": [...]
},
"aggregations": {
"aggs": {
"buckets": []
}
}
}
On Monday, September 1, 2014 1:40:00 PM UTC+1, vineeth mohan wrote:
>
> Hello Chris ,
>
> This should work -
>
> {
> "query" : {
> // GIVE QUERY HERE
> },
> "aggregations": {
> "aggs": {
> "terms": {
> "field": "_index"
> }
> }
> }
> }
>
> Thanks
> Vineeth
>
>
> On Mon, Sep 1, 2014 at 3:10 PM, Chris Lees <[email protected]
> <javascript:>> wrote:
>
>>
>> I'm building a simple app which presents the user with two drop-downs to
>> easily filter data: one for day (mapping to my daily indices), and one for
>> client (a term within documents).
>>
>> I'm currently finding indices using curl -XGET localhost:9200/_aliases,
>> and a simple aggregation query to get a list of known clients over all
>> indices. It works, but since not every client is present on every date it
>> feels clunky when the client is known but the list of dates still contains
>> all indices, many of which are irrelevant for the selected client.
>>
>> Can anyone recommend a good way of finding a list of indices in which
>> there is at least one document containing a specified term please? Thank
>> you very much.
>>
>> --
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elasticsearch/3dcf46da-3eeb-4503-a348-365e3f0fd7a0%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/elasticsearch/3dcf46da-3eeb-4503-a348-365e3f0fd7a0%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/a485bf59-4ab6-43a3-b3df-172b8d09e7ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.