Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AND検索の対象フィールド拡張可否 #163

Open
Stag0007 opened this issue Jan 24, 2025 · 16 comments
Open

AND検索の対象フィールド拡張可否 #163

Stag0007 opened this issue Jan 24, 2025 · 16 comments

Comments

@Stag0007
Copy link

下記フィールドを跨いでの「AND検索」が出来ず、何とか出来るようにならないでしょうか。。。
Redmine5.1では、全検索対象テキストが実装され、
こちらのプラグインでも実装いただければ、とてもありがたいです。

・AND検索可
 ・題名 AND  題名
 ・題名 AND 説明
 ・説明 AND 説明

・AND検索不可
 ・題名/説明 AND コメント/カスタムフィールド
 ・コメント#1 AND コメント#2
 ・コメント AND カスタムフィールド
 ・カスタムフィールドA AND カスタムフィールドB

@kou
Copy link
Member

kou commented Jan 24, 2025

検索対象を指定した全文検索をしたいというのであっていますか?

それとも、Redmineのチケット検索画面と統合できないか?という話ですか?

@Stag0007
Copy link
Author

全文検索で複数フィールドを跨いでAND検索出来れば、というお願いになります。
具体的には、題名、説明、コメント、カスタムフィールドの値を検索対象に出来れば。

@kou
Copy link
Member

kou commented Jan 24, 2025

あれ、今ってすべてのフィールドに対しての全文検索になっていませんか?

@kou
Copy link
Member

kou commented Jan 24, 2025

https://redmine.example.com/search とかの検索画面での話ですよね?

@Stag0007
Copy link
Author

Stag0007 commented Jan 24, 2025

全文検索自体は全てのフィールドが対象なんですが、(多分カテゴリ以外)
AND検索を行うと、複数フィールドを跨いでヒットしないようになっているかと思います。
下記バージョンを使用しています。
Redmine:4.2
full text search:1.0.4

@kou
Copy link
Member

kou commented Jan 24, 2025

うーん、AND検索はどうやってやっていますか?

「キーワード1 AND キーワード2」ではなく、「キーワード1 キーワード2」と指定することになります。

ところで。。。
Redmine 4.2はすでにサポートされていないのでバージョンアップしたほうがいいかと思います。。。

@Stag0007
Copy link
Author

ご記載いただいた通り、キーワード1 キーワード2で検索しています。
使用プラグイン未対応等があり、難しいです。。。

@Stag0007
Copy link
Author

実際の検索画面ではこのような感じです。

Image

@kou
Copy link
Member

kou commented Jan 24, 2025

あぁ、わかった気がします。

今は、検索結果の各エントリーがチケットの説明とかチケットのコメントの単位になっているのを、チケットに紐づくどれか(説明でもコメントでもカスタムフィールドでも)がヒットしたら、対象がどれでも紐づいているチケットが検索結果のエントリーにしたい、という話な気がします。とすると、チケット一覧ページでの検索フォームに統合するのがそれっぽいんですよねぇ。その場合、ソートが効かなくなる(既存のチケットのソート機能を使うことになる)のですが、それはアリですか?

使用プラグイン未対応等があり、難しいです。。。

[PR] 有償ですが、クリアコードという会社が未対応プラグインのメンテナンスも含めてRedmineのバージョンアップサポートやこのプラグインのサポートも含んだサポートサービスを提供しているので、必要であれば問い合わせしてみてください。

@Stag0007
Copy link
Author

全文検索=チケットの検索機能のイメージで使用していますので、その通りです。
ハイライトが使えなくなるのが残念ですが。。。
チケット一覧のフィルターに全文検索が追加されるイメージでしょうか。
既存のチケット一覧でのソート機能でも大丈夫です。

サポートの紹介までいただき、ありがとうございます。検討させていただきます。

@kou
Copy link
Member

kou commented Jan 24, 2025

ハイライトが使えなくなるのが残念ですが。。。

あぁ、そうですね。UI的にハイライトを表示する箇所がなくなるのでそうなります。タイトルにマッチした場合だけならいけるかも。。。?

チケット一覧のフィルターに全文検索が追加されるイメージでしょうか。

検索対象に既存の「題名」や「説明」のように「全文検索」が追加されるみたいなイメージですか?

そうではなくて、できれば、検索対象のところではなく、「含む」とか「いずれかを含む」とかが出てくる検索方法のところでやれるといいなぁと思っています。たとえば、このプラグインがインストールされた状態で既存の「含む」とかの検索方法を指定したら高速に検索できるようになる、みたいなイメージです。(新しい検索方法を追加するのではなく。)

@Stag0007
Copy link
Author

その場合、検索対象は各フィールドを指定して、フィールド同士はor条件とかですか?
あまりイメージが出来ないですが、全文検索からは離れる気が。

@kou
Copy link
Member

kou commented Jan 27, 2025

検索対象は各フィールドを指定しますが、フィールド同士はANDです。既存のチケット一覧のフィルターもANDなはずなので、それと同じになります。

あれ、うーん、あぁ、フィールドごとにANDしたいわけじゃなかったんでしたね。各キーワードがどのフィールドに出現してもよくしたいのか。それが「全検索対象テキスト」フィールドになるわけですか。

「全検索対象テキスト」フィールドのRedmineの実装をざっと見てみましたが、このプラグインで置き換えることもできそうな気はするので、その方向で実現するのがよさそうな気がしてきました。

@Stag0007
Copy link
Author

フィールド同士はANDになってしまいますか。
フィールドを跨いでのAND検索がこちらのプラグインで実装いただけるなら、とてもありがたいです。

@otegami
Copy link
Contributor

otegami commented Jan 30, 2025

フィールドを跨いでのAND検索がこちらのプラグインで実装いただけるなら、とてもありがたいです。

はい、こちらフィールドを跨いでのAND検索を実現できるように進めていきますね。
具体的には、チケット一覧での「全検索対象テキスト」フィルターを拡張する方針で実現して行こうと考えています 🙏🏾

Image

@otegami
Copy link
Contributor

otegami commented Jan 30, 2025

TODO

全検索対象テキストを利用して、フィールドを跨いだAND検索をできるようにする

otegami added a commit to otegami/redmine_full_text_search that referenced this issue Jan 30, 2025
…earches

GitHub: clear-codeGH-163

This commit introduces the `FullTextSearch::IssueAnySearchable`
module to the `IssueQuery` class. The module is designed to
support AND-based searches across multiple fields.

This initial implementation only sets up the module and its
interface without implementing the actual search logic.

At the following PRs, we will implemente the search logic and
adding relevant tests.
kou pushed a commit that referenced this issue Feb 28, 2025
…AND searches (#164)

GitHub: GH-163

This PR introduces the `FullTextSearch::IssueQueryAnySearchable` module
to the `IssueQuery` class.
The module is designed to support AND-based searches across multiple
fields.

This initial implementation only sets up the module and its interface
without implementing the actual search logic.
At the following PRs, we will implement the search logic and add
relevant tests.
kou pushed a commit that referenced this issue Feb 28, 2025
GitHub: GH-163

The `issue_contents` table was previously used for a "similar issue"
search feature.
But that feature was rarely used. We will change the purpose of this
table for a new "multi-field AND" search across fields.
To support this, we introduce a singular "content" column that has data
from multiple fields for each issue.

We've removed the `contents` column and `is_private` column.
- `contents` is no longer needed because we are unifying data into the
single `content` column.
- `is_private` is removed to simplify the design for now. Private issues
will not be included in the search at all.
- If we think of the private issues, it will be too complicated. So we
will add it again when we really need it.

At the following PRs, we will implement the search logic and add
relevant tests using this table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants