بحث باستخدام الأحرف البدل

مرحباً،

هل توجد طريقة (سهلة) لتمكين وظيفة البحث باستخدام الأحرف البدائية (wildcard) في منصة Discourse الخاصة بي؟

أدير منصة Discourse مغلقة وصغيرة محليًا في العمل. لا يتجاوز عدد المستخدمين فيها حوالي 10 أشخاص، لذا لا نتحدث عن كميات منشورات ضخمة كما في المجتمعات الكبيرة.

رأيت هذه الإضافة Algolia التي تبدو مثالية، لكن ذلك يتطلب فهرسة المنتدى، ولا يمكننا السماح ببياناتنا بمغادرة الشبكة المحلية.

أريد أن أتمكن من العثور على عناصر مثل “DE322X” عند البحث عن “322X” :slight_smile:

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 إعجابات

Thanks, I will save this for later. Might come in handly :slight_smile:
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 :confused:

إعجاب واحد (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

على الرغم من أنه يمكنك ربما إضافة فئة معينة أو نطاق تاريخي إذا كنت ترغب في تقييده بشكل أكبر.

بمجرد كتابته، يمكنك جعله متاحًا لمجموعات معينة لاستخدامه:


على الرغم من أنني أقدر عمله من شريط البحث وهو ما يسعى إليه صاحب الموضوع في الوضع المثالي. :slight_smile: سأنقل هذا إلى Feature في حال كان هناك المزيد من الطلب عليه.