我正在努力理解Solr MorelIkeThis是如何工作的。我做过的步骤-
字段name="path_exact“type=字符串”indexed=“真”stored=“真”termVectors=“真”/>“
字段name=标题“type="text_general”indexed=“真”stored=“真”multiValued=“真”termVectors=“真”/>“
结果-
<lst name="moreLikeThis">
<result name="id1" numFound="0" start="0"/>
<result name="id2" numFound="0" start="0"/>
谢谢你的帮忙!
发布于 2015-03-25 05:07:16
我有点不明白您到底做了什么,但是如果您想要设置MLT,可以向核心目录中的solrconfig.xml添加一个请求处理程序(我假设Solr4.0和更高版本)。因此,一些类似于:
<!-- More Like This -->
<requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
<lst name="defaults">
<!--similar documents defaults-->
<!--The fields to use for similarity-->
<str name="mlt.fl">article_title, abstract_text</str>
<!--Minimum Term Frequency - the frequency below which terms will be ignored in the source doc.-->
<str name="mlt.mintf">2</str>
<!--Minimum Document Frequency - the frequency at which words will be ignored which do not occur in at least this many docs.-->
<str name="mlt.mintf">5</str>
<!--Minimum word length below which words will be ignored.-->
<str name="mlt.mintf">0</str>
<!--Maximum word length above which words will be ignored.-->
<str name="mlt.mintf">0</str>
<!--Minimum number of query terms that will be included in any generated query.-->
<str name="mlt.mintf">25</str>
<!--Maximum number of query terms that will be included in any generated query.-->
<str name="mlt.mintf">25</str>
</lst>
</requestHandler>然后对Solr执行一个正常的HTTP请求:
http://localhost:8983/solr/mlt?q="myquery"或者在向“&mlt=true?”发送请求时设置“/select”标志?请求处理程序,例如solr提供的示例:
http://localhost:8983/solr/select?q=apache&mlt=true&mlt.fl=manu,cat&mlt.mindf=1&mlt.mintf=1&fl=id,scorehttps://stackoverflow.com/questions/28940996
复制相似问题