Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multivalued attribute grouping in SOLR

Tags:

solr

I came across a problem where one of my column is multivalued. eg: value can be (11,22) (11,33) (11,55) , (22,44) , (22,99)

I want to perform a grouping operation that will yield:

  • 11 : count 3
  • 22 : count 3
  • 33 : 1
  • 44 : 1
  • 55 : 1
  • 99 : 1
like image 938
Maths Gal Avatar asked Jul 13 '12 04:07

Maths Gal


1 Answers

One indirect way to achieve this is to copy all the values corresponding to this field with space or some other character between them in a text field and then tokenize this field with that character(using whitespace tokenizer in case of spaces). Then you can use group by and I believe that this should work.

like image 143
Suryansh Purwar Avatar answered Oct 03 '22 06:10

Suryansh Purwar