我在使用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我的问题是如何通过"/terms“requestHandler使用"/select”requestHandler?
来自Solr的日志如下所示(如果它对您有任何帮助)
Apr 12, 2013 10:21:55 AM org.apache.solr.core.SolrCore execute
INFO: [collection1] webapp=/solr path=/terms params={terms.fl=INDUSTRY&terms=true&terms.prefix=P} status=0 QTime=5
Apr 12, 2013 10:22:09 AM org.apache.solr.core.SolrCore execute
INFO: [collection1] webapp=/solr path=/select params={terms.fl=INDUSTRY&terms=true&qt=terms&terms.prefix=P} hits=0 status=0 QTime=0 发布于 2013-04-12 17:45:46
以下步骤解决了上述问题。
首先,在solrconfig.xml中,您应该删除"/select“requestHandler,并且将handleSelect设置为true。
<requestDispatcher handleSelect="true" >其次,重新启动Solr,然后执行以下查询:
http://localhost:8983/solr/collection1/select?qt=/terms&terms.fl=INDUSTRY&terms.prefix=P&terms=true重要提示:请注意qt参数上的"/terms“,使用"qt=terms”将不起作用。
发布于 2013-11-15 18:46:55
在您的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
https://stackoverflow.com/questions/15966517
复制相似问题