Closed breyten closed 9 years ago
See #74
Why don't you just use the combined index? The collection name is present there as well, so running the following aggregation only on ocd_combined_index
should yield accurate counts:
{
"aggs": {
"collections": {
"terms": {
"field": "meta.collection"
}
}
},
"size": 0
}
Also, documentation and tests are missing :-)
Yeah, the source_id
and collection
are really essential pieces of information for this endpoint.
To prevent having to hit all of the indexes, we could use the same sub-aggreations trick you are using, but instead of the _index
field use the meta.source_id
field.
Shouldn't the size
of the first aggregation be set to 0
in order to get all of the values (in case there are more than 10 collections)?
Some details about testing Flask apps can be found here: http://flask.pocoo.org/docs/0.10/testing/.
I had no idea source_id was actually in meta :P
Ugh, this is kind of a dup :P
Yay for Elasticsearch aggregations!