Solr More Like This(MLT)没有返回结果

Naq*_*eeb 2 solr pysolr django-haystack morelikethis

我目前正在寻求基于索引中的许多字段实现更多类似于此功能的功能.

我目前的配置如下:Haystack | PySolr | Solr的

对于这篇文章我正在使用PySolr并将参数传递给more_like_this函数.响应找到文档但不找到任何相关结果.这是为什么?

这是我点击的网址:

http://localhost:8080/solr/mlt?q=django_id:12123412&mlt.fl=industry_ids,loc_state,amount,sector_id&mlt.interestingTerms=details
Run Code Online (Sandbox Code Playgroud)

以下是我对Solr的回复:

<response>
<object type="{XXXXXX-0F1D-4F28-AAA2-XXXXXXXXXXX}" cotype="cs" id="cosymantecbfw" style="width: 0px; height: 0px; display: block;"/>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">24</int>
</lst>
<result name="match" numFound="1" start="0">
    <doc>...</doc>
</result>
<result name="response" numFound="0" start="0"/>
<lst name="interestingTerms"/>
</response>
Run Code Online (Sandbox Code Playgroud)

solrconfig.xml中

<!-- More Like This -->
<requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
</requestHandler>
Run Code Online (Sandbox Code Playgroud)

schema.xml中

<field name="award_amount" type="sfloat" indexed="true" stored="true" multiValued="false" termVectors="true" />
<field name="estatus" type="slong" indexed="true" stored="true" multiValued="false" termVectors="true"/>
<field name="loc_state" type="string" indexed="true" stored="true" multiValued="false" termVectors="true"/>
<field name="orgtype_id" type="string" indexed="true" stored="true" multiValued="false" termVectors="true" />
<field name="sector_id" type="string" indexed="true" stored="true" multiValued="false" termVectors="true"/>
<field name="industry_ids" type="string" indexed="true" stored="true" multiValued="true" termVectors="true" />
<field name="award_amount_exact" type="sfloat" indexed="true" stored="true" multiValued="false" termVectors="true" />
<field name="sector_id_exact" type="string" indexed="true" stored="true" multiValued="false" termVectors="true"/>
<field name="amount_exact" type="sfloat" indexed="true" stored="true" multiValued="false" termVectors="true"/>
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激!

Jes*_*ose 7

您的文本字段必须具有类型text,该类型对其进行处理以使其可搜索.这些string字段按原样存储和查询,因此它们无法搜索,因此对MLT无用.

请参阅复制场如果你想存储相同的数据都text和string(例如,小面).


我看到你也打算找到最接近我们查询的数字.MLT不适合这种情况.您想为此撰写函数查询.SolR:更多类似于数字字段

  • 我意识到我的mlt.mintf和mlt.mindf设置很高,这使我无法收到结果. (4认同)