Solr faceting returning the average and the count

621 views Asked by At

I'm using Solr 4.10 to apply the geohashing technique to create clusters of markers to display on a map. My documents represent locations on a map, and each document has a multivalue field with the geohashes per zoom level. The solutions is as described here.

I'm using faceting to generate the clusters, which returns me a list of pairs with the geohash and the number of documents that have the given geohash. Since the geohashes represent the clusters, then I convert the geohash to lat/lng values and those are the coordinates where I place my clusters.

Is it possible to make the facet return the average of a field alongside the count? Basically I want to determine the cluster position through the average of each latitude and longitude of the markers that belong to the cluster. I know that since Solr 5.1 we can use facet functions but I'm stuck to the 4.10 version.

Thanks in advance.

1

There are 1 answers

0
Paulo Rodrigues On

It seems that facet functions is available only from Solr 5.1. With this feature you can return more than one metric per facet, like average, sum, min, max, etc..