Solr 使用;术语;vs";选择“qt=术语”;在索尔

Solr 使用;术语;vs";选择“qt=术语”;在索尔,solr,Solr,我在使用Solr4.2.0的“/terms”请求处理程序时遇到困难 使用web浏览器,以下url返回fieldName行业的术语列表 http://localhost:8983/solr/collection1/terms?terms.fl=INDUSTRY&terms.prefix=P&terms=true 另一方面,以下查询不返回任何术语: http://localhost:8983/solr/collection1/select?qt=terms&terms.fl

我在使用Solr4.2.0的“/terms”请求处理程序时遇到困难

使用web浏览器,以下url返回fieldName行业的术语列表

http://localhost:8983/solr/collection1/terms?terms.fl=INDUSTRY&terms.prefix=P&terms=true
另一方面,以下查询不返回任何术语:

http://localhost:8983/solr/collection1/select?qt=terms&terms.fl=INDUSTRY&terms.prefix=P&terms=true
我的问题是如何通过“/select”请求处理程序使用“/terms”请求处理程序

Solr的日志如下(如果对您有帮助的话)


以下步骤解决了上述问题

首先,在solrconfig.xml中,应该删除“/select”请求处理程序,并将handleSelect设置为true

  <requestDispatcher handleSelect="true" >

重要提示:请注意qt参数上的“/terms”,使用“qt=terms”将不起作用。

在requesthandler中,您可以添加以下内容:

    <lst name="defaults">
         <bool name="terms">true</bool>
    </lst> 

    <arr name="last-components">
        <str>terms</str>
   </arr>

真的
条款
现在,您可以使用terms.fl从select requesthandler中选择所需的术语:


http://localhost:8983/solr/select?terms.fl=INDUSTRY

谢谢你的回答,杰拉德!似乎在默认的requestHandler中添加terms组件是最好的方法。需要强调的是,必须删除默认的“/select”requestHandler。其他支持信息如下:
http://localhost:8983/solr/collection1/select?qt=/terms&terms.fl=INDUSTRY&terms.prefix=P&terms=true
    <lst name="defaults">
         <bool name="terms">true</bool>
    </lst> 

    <arr name="last-components">
        <str>terms</str>
   </arr>