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 Thomas Scheffler <th...@uni-jena.de> on 2014/05/21 14:56:01 UTC

grouping of multivalued fields

Hi,

I have a special case of grouping multivalued fields and I wonder if 
this is possible with SOLR.

I have a field "foo" that is generally multivalued. But for a restricted 
set of documents this field has one value or is not present. So normally 
grouping should work.

Sadly SOLR is failing fast and I wonder if there is some way to specify 
"group by first|any|last|min|max (means all the same here) value of foo".

regards,

Thomas

Re: grouping of multivalued fields

Posted by Thomas Scheffler <th...@uni-jena.de>.
Am 21.05.2014 15:07, schrieb Joel Bernstein:
> You may want to investigate the group.func option. This would allow you to
> plug in your own logic to return the group by key. I don't think there is
> an existing function that does exactly what you need so you may have to
> write a custom function.

I thought of max(foo) for it but sadly it does work on multivalued 
fields either. I wait for other suggestions and start looking at custom 
functions (did not known that option exists) in parallel.

Thanks,

Thomas

Re: grouping of multivalued fields

Posted by Joel Bernstein <jo...@gmail.com>.
You may want to investigate the group.func option. This would allow you to
plug in your own logic to return the group by key. I don't think there is
an existing function that does exactly what you need so you may have to
write a custom function.

Joel Bernstein
Search Engineer at Heliosearch


On Wed, May 21, 2014 at 8:56 AM, Thomas Scheffler <
thomas.scheffler@uni-jena.de> wrote:

> Hi,
>
> I have a special case of grouping multivalued fields and I wonder if this
> is possible with SOLR.
>
> I have a field "foo" that is generally multivalued. But for a restricted
> set of documents this field has one value or is not present. So normally
> grouping should work.
>
> Sadly SOLR is failing fast and I wonder if there is some way to specify
> "group by first|any|last|min|max (means all the same here) value of foo".
>
> regards,
>
> Thomas
>