質問

私は現在、私のインデックス内の多くのフィールドに基づいて、この機能のようなものをより実装しようとしています。

現在の構成は次のとおりです。HayStack| pysolr | solr

この作品では、pysolrを使用して、パラメーターをmore_like_sis関数に渡します。応答はドキュメントを見つけますが、関連する結果は見つかりません。何故ですか?

これが私がヒットしたURLです:

http://localhost:8080/solr/mlt?q=django_id:12123412&mlt.fl=industry_ids,loc_state,amount,sector_id&mlt.interestingTerms=details

これが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>

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

どんな助けも感謝します!

役に立ちましたか?

解決

テキストフィールドにはタイプが必要です text, 、それらを処理してそれらを作成します 検索可能. 。 string フィールドはそのまま保存され、質問されるので、 それらは検索できません, 、それらをMLTで役に立たないようにします。

参照 フィールドをコピーします 両方と同じデータを保存したい場合 textstring (たとえば、ファセット)。


また、私たちのクエリに最も近い数字を見つけるつもりです。 MLTはそのために正しくありません。あなたはaを構成したい 関数クエリ そのために。 solr:数字フィールドでこのように

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top