我在使用 Solr 4.2.0 的“/terms”请求处理程序时遇到困难。
使用 Web 浏览器,以下 url 返回 fieldName INDUSTRY 的术语列表
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”requestHandler 使用“/terms”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
以下步骤解决了上述问题。
首先,在 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”将不起作用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)