1

私はsolr 4.10を使用しています。フィールド ブーストとドキュメント スコアに基づいて、ドキュメントの関連性を変更する必要があります。そのためには、関数クエリを使用する必要があることを知りました。以下は、スキーマのブースト フィールドの構文です。

<field name="boost" type="float" stored="true" indexed="false" default="1.0"/>

私の最初の質問は、保存されたフィールドでのみ関数クエリを使用できるかということです。

上記のスキーマを使用しようとすると、次のクエリのように

http://localhost:8983/solr/select?q=bank&df=keywords&fl=id&sort=pow(score,%20boost)%20asc

のように言うエラーがありました

sort param could not be parsed as a query, and is not a field that exists in the index: 

次に、スキーマを次のように変更しました

<field name="boost" type="float" stored="true" indexed="true" default="1.0"/>

その後、上記の問題はなくなりましたが、クエリに新しいエラーが表示されました

http://localhost:8983/solr/select?q=bank&df=keywords&fl=id,pow(score,%20boost)

以下のエラーが表示されました

<lst name="error">
<str name="msg">undefined field: "score"</str>
<int name="code">400</int>
</lst>

どこが間違っていますか?ブーストフィールドの属性を変更するのは正しいですか?

4

1 に答える 1