2012-02-16 14 views
2

私は現在、インデックス内のいくつかのフィールドに基づいてこの機能を実装したいと考えています。Solr Like More(MLT)結果が返されない

現在の設定は次のとおりです。 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 

はSolrのからの私の応答である:ここで

は私がヒットURLです

<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> 

solrconfig.xml

<!-- More Like This --> 
<requestHandler name="/mlt" class="solr.MoreLikeThisHandler"> 
</requestHandler> 

の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"/> 

助けてください。

答えて

7

テキストフィールドのタイプはtextで、検索可能になります。 stringフィールドはそのまま格納され、照会されるため、は検索できません、MLTでは役に立たなくなります。あなたは両方textstring(例えば、ファセット)と同じデータを保存したい場合は

コピーフィールドを参照してください。


私はあなたの質問に最も近い数字を見つけることを意図しています。 MLTはそうではありません。そのためには、関数クエリを作成します。 SolR : More Like This on number fields

+4

私のmlt.mintfとmlt.mindfの設定が高くて、結果を受け取ることができないことに気付きました。 – Naqeeb

関連する問題