search-api
search-api copied to clipboard
Simplify aggregation functionality
Moved from https://trello.com/c/l4ygDSL2/15-simplify-aggregation-functionality
What
Review if we can simplify the aggregation code. We identified a few issues when replacing facets (deprecated in Elasticsearch 1.7) with aggregates.
Why
This code was designed for an older version of elasticsearch, using the older "facet" functionality. When we upgraded, we just ported it over.
Also, when aggregating on a field in the search API you can specify:
- scope
- order
- examples
- example_scope
- example_fields
We're not sure if we still need all this functionality. From Richard Boulton:
I think the example_scope: part of it may always be given with "query" as the value. (Or the other way around) If true, there'll be a big chunk of code that could be deleted there.
(example)