Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We would like to show the average value of a number column that is part of the search results inside a facet.
The result would then be that the facet, besided a #count attribute, also gets a #average attribute.
We could then use that average in, for example, this facetapi_graph widget we are working on.
What would be the best approach to implement this?
Comments
Comment #1
batje CreditAttribution: batje commentedI came across this page (for Solr) that pretty much describes that (at least) Solr can do exactly this.
That page also describes these statistics can be loaded on a field within a query basis. There is also an issue for this in the search_api queue.
Comment #1.0
batje CreditAttribution: batje commentedUsed the phrasing for the issue in the search_api issue queue
Comment #2
NWOM CreditAttribution: NWOM commentedAggregating by Average would be incredibly beneficial for the project I'm working on right now as an example.
Comment #3
NWOM CreditAttribution: NWOM commented