开发者

Facet a multivalue field (Solr powered Tag Cloud pt II)

开发者 https://www.devze.com 2023-03-02 16:05 出处:网络
This is related to this: Solr powered Tag Cloud However i decided to create another question since it\'s different from the original scope of the first question.

This is related to this: Solr powered Tag Cloud However i decided to create another question since it's different from the original scope of the first question. Here's the deal, I ve managed to index a multivalued field with multiple words for a tag cloud:

    <arr name="words">
<str>builders_NNS</str>
<str>builders_NNS</str>
<str>buildings_NNS</str>
<str>buildings_NNS</str>
<str>construction_NN</str>
<str>construction_NN</str>
<str>green_JJ</str>
<str>green_JJ</str>
</arr>

But when I facet on the query with simple parameters: &facet=true&facet.field=words&facet.mincount=1

It fails to facet them correctly, it doesn't sum up the values... Do i need to send anothe开发者_运维百科r extra parameter since it's a multivalued field? Response from Solr once i apply the faceting:

<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="words">
<int name="builders_NNS">1</int>
<int name="buildings_NNS">1</int>
<int name="construction_NN">1</int>
<int name="green_JJ">1</int>
</lst>
</lst>
</lst>

My field is defined as follows:

<field name="words" type="string" indexed="true" stored="true" multiValued="true" />

And i'm using Solr 1.4, Thanks!


Answering my own question in here: Solr is not capable (at least version 1.4, I haven't migrated to 3.2 yet and see if it's possible) to facet multivalued fields that are repeated in the same document, however it correctly groups repeated valued from different multivalued fields. Therefore the approach I was taking isn't possible (just yet).

0

精彩评论

暂无评论...
验证码 换一张
取 消