We're currently working on a search that implements Elastic's GeohashGrid aggregation feature. So far I have found no obvious way to make this work with this module. I can get the query to return useful results from the server using hook_search_api_elasticsearch_elastica_query_alter(), but the SearchApiElasticsearchElastica service simply ignores the results when building the standard Search API search results.

Short of implementing my own service class, is there a more pragmatic way to use aggregations? Is it on the roadmap for this module?

Comments

Anonymous’s picture

Yes, we plan on supporting this. I may be able to get to it in the next couple of weeks, but I'm not positive.

mathieuhelie’s picture

We're going to be building a series of sites requiring aggregation features over the coming months. If you detail the technical architecture of the feature, we can get development started on it and send pull requests.

Right now we're doing a patch that adds an 'elasticsearch_aggregations' key to the search results in parseSearchResponse, which is a straight call to $response->getAggregations() with no processing.

That's enough to build on the search_api query results for the remainder of our features. Still, if we can pull some weight, we'd be happy to.

mathieuhelie’s picture

Attaching a small patch that adds aggregations to Search API results (provided they were added to the Elastica Query through the alter hook).