user2
(Tony)
2019 年 10 月 23 日午前 7:30
1
こんにちは、
Discourse でワイルドカード検索機能を簡単に実装する方法はありますか?
私は職場で小規模なクローズドな Discourse をローカルで運用しています。ユーザーは約 10 名しかおらず、大規模なコミュニティのような投稿数はありません。
この Algolia プラグインは完璧な解決策のように見えますが、フォーラムのインデックス作成が必要で、データをローカルネットワーク外に流出させることができないため、利用できません。
「322X」と検索したときに「DE322X」のようなものを見つけたいのです
「いいね!」 3
There might be a couple of ways to do this using our Discourse Data Explorer Plugin .
You could run this simple query and then click the CSV button to download all posts. Then, you could search across the exported file using a different program.
`SELECT id, raw from posts`
You could write a custom data explorer query to search for the keyword across all post content.
Using the Data Explorer here would ensure that your data doesn’t leave the local network.
「いいね!」 3
user2
(Tony)
2019 年 10 月 23 日午前 8:10
3
Thanks, I will save this for later. Might come in handly
But for this I need the whole team to be able to search stuff and would be a real hassle if everyone needed to dump a CSV file every time to find what they need
「いいね!」 1
Sure, then writing a custom query and seeing the results in the UI would be the way to go. See What cool data explorer queries have you come up with? for inspiration on writing queries.
「いいね!」 2
十分に小さいサイトであれば、このようなものが機能する可能性があります。
-- [params]
-- string :query
SELECT p.id AS post_id,
p.user_id
FROM posts p
WHERE p.raw ~* :query
AND p.deleted_at IS NULL
さらに絞り込みたい場合は、特定のカテゴリや日付範囲を追加することもできます。
記述したら、特定のグループが使用できるようにすることができます。
検索バーから機能することが、理想的にはOPが求めているものであると理解しています。 より多くの需要がある場合に備えて、これを Feature に移動します。