SurroundQuery パーサー? 近接演算子 | KandaSearch Community Support Forum

SurroundQuery パーサー? 近接演算子

トピック作成者:ks-solruserml-bot (2025/04/30 10:25 投稿)
4
OpenOpen

(The bot translated the original post https://lists.apache.org/thread/kk271vkjq3hobcptw83oj5lws5gqsdyy into Japanese and reposted it under Apache License 2.0. The copyright of posted content is held by the original poster.)

こんにちは、みなさん

次のようなクエリを実行したいと考えています:

(keyword1 OR keyword2 OR keyword3) の3語以内に (keyword4 OR keyword5 OR keyword6)がある

次のように定義された title フィールドで試しています:

<field name="ti" type="text_general" multiValued="true" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true">

次のように surroundQuery を試しました:

3W(ti:(car OR bus), ti:(kids OR adult))

これは動作するのですが、以下のように良い結果も悪い結果も返してしまいます:

  • "Protective device of car for kids":良い結果
  • "Quick bus car washer":悪い結果("kids" や "adult" の語が存在しない)

このようなクエリを正確に実行する方法について、何かアイデアはありますか?

ご協力ありがとうございます!

Bruno Mannina

返信投稿者:ks-solruserml-bot (2025/04/30 10:25 投稿)

こんにちは、みなさん

私のクエリ:3W(ti:(car OR bus), ti:(kids OR adult)) において、

ふと気づいたのですが、
debugQuery を確認すると、3W が演算子としてではなく、キーワードとして扱われているようです!

よろしくお願いします、
Bruno Mannina

返信投稿者:ks-solruserml-bot (2025/04/30 10:25 投稿)

この構文を使うには、明示的に Surround クエリパーサーを設定する必要があります。
例えば(未検証ですが)以下のようにします:

defType=surround&df=ti&q=3w(car OR bus,kids OR adult)

返信投稿者:ks-solruserml-bot (2025/04/30 10:26 投稿)

こんにちは Matthias さん、

ご返信ありがとうございます。本日試してみます。

良い一日をお過ごしください!

Bruno Mannina

返信投稿者:ks-solruserml-bot (2025/04/30 10:26 投稿)

こんにちは Matthias さん、

うまくいきました!以下のように入力できます:
3W(car OR bus, kids OR adult)
または
3N(car OR bus, kids OR adult)

3W は語順を考慮し、
3N は語順を問わず検索します。

本当にありがとうございました!

Bruno Mannina

トピックへ返信するには、ログインが必要です。

KandaSearch

Copyright © 2006-2025 RONDHUIT Co, Ltd. All Rights Reserved.

投稿の削除

この投稿を削除します。よろしいですか?