0

I'm tring to get terms frequency on Solr4.3 but it don't work. I have tried with multivalue fields and not but it don't work with both. I have read in this post (SOLR term frequency) that multivalue field not work with terms :(. It's true?. This is my request:

http://localhost:8983/solr/test/select?q=casa&qs=3&fl=*&mm=1&qf=name&defType=dismax&wt=xml&hl=true&terms=true&terms.fl=name

In schema.xml file I have this code:

<field name="id"            type="string"     indexed="true"    stored="true"    required="true" /> 
   <field name="name"           type="text"                         stored="true"    required="true"        termVectors="true"  termPositions="true"    termOffsets="true" /> 

   <field name="review"         type="text"       indexed="true"    stored="true"    multiValued="true"     termVectors="true"  termPositions="true"    termOffsets="true" /> 
   <field name="description"    type="text"       indexed="true"    stored="true"    multiValued="true"     termVectors="true"  termPositions="true"    termOffsets="true" /> 
   <field name="id_b"           type="text"       indexed="true"    stored="true"    multiValued="true"  />
   <field name="id_c"           type="text"       indexed="true"    stored="true"    multiValued="true"  />

Please, any suggests? Thanks in advance.

4

1 回答 1

1

您可能缺少使用搜索处理程序添加最后一个组件。

以下配置适用于 Solr 4.3

<requestHandler name="/select" class="solr.SearchHandler">
    <lst name="defaults">
        <str name="echoParams">explicit</str>
        <int name="rows">10</int>
        <bool name="terms">true</bool>
        <str name="df">text</str>
    </lst>
    <arr name="last-components">
        <str>terms</str>
    </arr>    
</requestHandler>

示例查询http://localhost:8983/solr/select?q=ipod&terms.fl=name返回响应和条款。

于 2013-06-12T04:09:00.077 回答