In Elastic Search I need to obtain a list of available Aggregations (formally Facets?) for the current result-set.
For example, if I do a search for "car" in a set of cars which have defined MAKE and MODEL fields, I would like it to not only give me a result set of cars, but also a list of makes and models I can filter by.
From what I can read, you have to request the aggregations you want. That can't be right because if I was eBay and I had a catalogue with hundreds of possible attributes, all of which are searchable, then telling the search engine what facets I would like to search by would be unscalable.
I'm Using:
I would expect to simply be able to call Elastica/ResultSet.php::getAggregations() on Line 194 here:
Point of reference:
Could someone please clarify what I need to do to achieve this?
In Elasticsearch, you have to explicitly mention which fields you want to aggregate upon. Why don't you implement a client side (client of Elasticsearch) logic of getting all the field names and build an Elasticsearch search request with aggregations for all those fields?