简体   繁体   English

SOLR 中的多值属性分组

[英]Multivalued attribute grouping in 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)例如:值可以是 (11,22) (11,33) (11,55), (22,44), (22,99)

I want to perform a grouping operation that will yield:我想执行一个分组操作,它将产生:

  • 11: count 3 11: 数 3
  • 22: count 3 22: 数 3
  • 33: 1 33:1
  • 44: 1 44:1
  • 55: 1 55:1
  • 99: 1 99:1

Multivalued field cannot be grouped in Solr as yet.目前无法在 Solr 中对多值字段进行分组。

Documentation :- 文档:-

Support for grouping on a multi-valued field has not yet been implemented.尚未实现对多值字段分组的支持。

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).实现此目的的一种间接方法是复制与该字段对应的所有值,并在文本字段中使用空格或它们之间的某些其他字符,然后使用该字符标记该字段(在空格的情况下使用whitespace tokenizer器)。 Then you can use group by and I believe that this should work.然后你可以使用 group by 我相信这应该有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM