検索するsolrクエリがあります(webpage_text:*test* OR company_text:*test*)
強調表示で、フィールドを に設定しましたwebpage_text, company_text
。しかし、検索語が webpage_text でしか見つからない場合でも、強調表示の結果で常に両方のフィールドを取得します。完全なフィールドである company_text の強調表示の結果も取得します。
一致したフィールドのハイライトのみを返すことはできますか?
requireFieldMatch を試しましたが、うまくいきません。
@EDIT: 重要な情報かもしれません: 2 つのフィールドは、実際にはコピー フィールドで埋められた空のフィールドです。これは影響がありますか?
<field name="company_text" type="text_general" indexed="true" stored="true" multiValued="true" default="" termVectors="true" termPositions="true" termOffsets="true"/>
<field name="webpage_text" type="text_general" indexed="true" stored="true" multiValued="true" default="" termVectors="true" termPositions="true" termOffsets="true"/>
<dynamicField name="*company_*" type="string" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*talent_*" type="string" indexed="true" stored="true" multiValued="true"/>
<copyField source="company_*" dest="company_text" maxLength="30000000"/>
<copyField source="webpage_*" dest="webpage_text" maxLength="30000000"/>
@EDIT2: 一致するものがない場合でも、常にコピーフィールドが強調表示されているように見えます。