You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Pablo Ricco <pr...@gmail.com> on 2011/09/12 23:37:46 UTC

How to return a function result instead of doclist in the Solr collapsing/grouping feature?

I have the following solr fields in schema.xml:

   - id (string)
   - name (string)
   - category(string)
   - latitude (double)
   - longitude(double)

Is it possible to make a query that groups by category and returns the
average of latitude and longitude instead of the doclist?

Thanks,
Pablo

Re: How to return a function result instead of doclist in the Solr collapsing/grouping feature?

Posted by Erick Erickson <er...@gmail.com>.
Well, what is the "average of latitude and longitude"? If you're asking
for the average of all the docs that match, or the average of all the
docs in the corpus, no, I don't think you can unless you write a custom
plugin.

Something like this has been talked about, see:
 https://issues.apache.org/jira/browse/SOLR-1622
but I don't think any such thing has been implemented.

Best
Erick

On Mon, Sep 12, 2011 at 5:37 PM, Pablo Ricco <pr...@gmail.com> wrote:
> I have the following solr fields in schema.xml:
>
>   - id (string)
>   - name (string)
>   - category(string)
>   - latitude (double)
>   - longitude(double)
>
> Is it possible to make a query that groups by category and returns the
> average of latitude and longitude instead of the doclist?
>
> Thanks,
> Pablo
>