lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhoomit Vasani <bhoomit.2...@gmail.com>
Subject Re: Grouping on a multi-valued field
Date Fri, 30 May 2014 10:44:00 GMT
Hi Erick,

Thanks for the response.

What am I trying to do? :

I have a multivalued field called tags for e.g.

   - {
      - id: "1",
      - *tags*:["solr","lucene","facet"],
      *type*:"post"
      },
   - {
      - id: "2",
      - *tags*:["solr","multi-valued","grouping"],
      *type*:"quote"
      },

.......


Now what I want is...
grouped:
{

   - type:
   {
      - matches: 578,
      - groups:
      [
         -
         {
            - groupValue: "solr",
            - doclist:
            {
               - numFound: 365,
               - start: 0,
               - docs:
               [
                  -
                  {
                     - id: "1",
                     - *tags*:["solr","lucene","facet"],
                     *type*:"post"
                     },
                  - {
                     - id: "2",
                     - *tags*:["solr","multi-valued","grouping"],
                     *type*:"quote"
                     },
                  -
                  ]
               }
            },
         - {
            - groupValue: "lucene",
            - doclist:
            {
               - numFound: 365,
               - start: 0,
               - docs:
               [
                  -
                  {
                     - id: "1",
                     - *tags*:["solr","lucene","facet"],
                     *type*:"post"
                     },
                  ]
               }
            },...


But when I run this
*http://127.0.0.1:8983/solr/select?wt=json&group=true&group.field=tags&q=*:*
<http://127.0.0.1:8983/solr/select?wt=json&group=true&group.field=tags&q=*:*>*
it
gives me error saying "*can not use FieldCache on multivalued field: tags*".
It works fine on type field which is single valued.

Hope the example is clear enough.


   -






On Thu, May 29, 2014 at 3:05 AM, Erick Erickson <erickerickson@gmail.com>
wrote:

> what  would "grouping on a multivalued field" mean? Count the same doc
> separately for each value in the MV field? Use the first value?
>
> This seems similar to the problem of sorting on fields with more than
> one token, any approach I can think of will be wrong.
>
> But this smells like an XY problem. What is the use-case you're trying
> to support? If you tell us that there might be alternate approaches
> that would work OOB.
>
> To answer your question "not that I know of".
>
> Best
> Erick
>
> On Mon, May 26, 2014 at 11:28 PM, Bhoomit Vasani <bhoomit.2010@gmail.com>
> wrote:
> >  Hi,
> >
> > Does latest release of solr supports grouping on a multi-valued field?
> >
> > According to this
> > https://wiki.apache.org/solr/FieldCollapsing#Known_Limitations it
> doesn't,
> > but the doc was last updated 14 months ago...
> >
> > --
> > --
> > Thanks & Regards,
> > Bhoomit Vasani | SE @ Mygola
> > WE are LIVE <http://www.mygola.com/>!
> > 91-8892949849
>



-- 
-- 
Thanks & Regards,
Bhoomit Vasani | SE @ Mygola
WE are LIVE <http://www.mygola.com/>!
91-8892949849

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message