تخطَّ إلى المحتوى

البحث الشامل السريع — دليل المطور وواجهة الإدارة

1. التثبيت وإعداد الاعتماديات

Section titled “1. التثبيت وإعداد الاعتماديات”
Terminal window
pnpm add @vicacha-devs/strapi-plugin-global-search

2. إعدادات الخادم (config/plugins.ts)

Section titled “2. إعدادات الخادم (config/plugins.ts)”

أضف إعدادات الإضافة إلى ملف config/plugins.ts في مشروع Strapi v5 الخاص بك:

config/plugins.ts
export default ({ env }: { env: (key: string, defaultValue?: string) => string }) => ({
"global-search": {
enabled: true,
config: {
minChars: 2,
maxResults: 100,
includeDrafts: true,
},
},
});

البحث الشامل السريع — Strapi v5 Settings Panel

3. جولة في واجهة الإدارة (Strapi v5 Admin UI — دعم RTL)

Section titled “3. جولة في واجهة الإدارة (Strapi v5 Admin UI — دعم RTL)”

بمجرد تفعيل الإضافة، يتم تسجيل مساحة العمل والإعدادات داخل لوحة تحكم Strapi v5 مع دعم كامل للغة العربية واتجاه RTL:

البحث الشامل السريع — Strapi v5 Admin UI

البحث الشامل السريع — Spotlight Cmd+K Command Palette

نماذج من نصوص الواجهة المعربة (العربية)

Section titled “نماذج من نصوص الواجهة المعربة (العربية)”
مفتاح الترجمة النص المعروض في الواجهة
plugin.name البحث الشامل
plugin.description ابحث في جميع أنواع المحتوى من مكان واحد.
settings.section البحث الشامل
settings.link الإعدادات
common.searching جارٍ البحث…
common.no_results لا توجد نتائج لـ “{query}”.
common.on تفعيل
common.off إيقاف

4. كيانات أنواع المحتوى ومواقعها ومخططاتها (strapi.documents)

Section titled “4. كيانات أنواع المحتوى ومواقعها ومخططاتها (strapi.documents)”

Operates as a universal zero-schema introspection engine over all registered Strapi v5 Content-Type entities (api::* collection types, single types, and plugin::* entities) plus nested components and dynamic zones. Uses strapi.contentTypes metadata and strapi.documents(uid).findMany() with RBAC permission filtering.

أين تجد كيانات أنواع المحتوى في Strapi v5

Section titled “أين تجد كيانات أنواع المحتوى في Strapi v5”
  • Spotlight Command Palette Overlay: Press Cmd+K (macOS) or Ctrl+K (Windows/Linux) from any Strapi Admin screen (including Content Manager, Calendar, or Settings)
  • Dedicated Search Workspace: /admin/plugins/global-search (Global Search in the main left sidebar)
  • Settings Panel: /admin/settings/global-search (Settings -> Global Search -> Configuration — organized into Search behaviour and Content types tabs)
  • Target Entities: Opens matched documents directly at /admin/content-manager/collection-types/{uid}/{documentId}?plugins[i18n][locale]={locale}

تعمل هذه الإضافة مباشرة على كيانات أنواع المحتوى الحالية في Strapi (api::* و plugin::*).

التكامل مع مدير المحتوى في Strapi v5 (/admin/content-manager)

Section titled “التكامل مع مدير المحتوى في Strapi v5 (/admin/content-manager)”

مجموعة الشريط الجانبي في مدير المحتوى: All Content Manager Collection Types & Single Types (Cmd+K/Ctrl+K)

الكيانات والمكونات المسجلة في مدير المحتوى

Section titled “الكيانات والمكونات المسجلة في مدير المحتوى”
  • Universal Introspection across all api::* and plugin::* Content Manager Collection Types, Single Types, and Nested Components

لماذا تنشئ هذه الإضافة كيانات داخل مدير المحتوى (Content Manager)؟

Section titled “لماذا تنشئ هذه الإضافة كيانات داخل مدير المحتوى (Content Manager)؟”

@vicacha-devs/strapi-plugin-global-search does not create an isolated database table because its entire purpose is to act as a high-speed Content Manager Command Palette & Deep-Link Router over every api::* and plugin::* entity registered in Strapi v5:

  • Instant Deep-Linking into Content Manager: Pressing Enter on any search result navigates directly to /admin/content-manager/collection-types/{uid}/{documentId}?plugins[i18n][locale]={locale} (or single-types/{uid}).
  • Searches Both Host api::* and Plugin plugin::* Entities: Simultaneously indexes articles, scholars (api::leader.leader), events (plugin::events.event), scripture entries (plugin::islam.scripture-entry), donations (plugin::donations.campaign), and publications (plugin::resources.publication).

كيفية الاستخدام داخل مدير المحتوى في Strapi (خطوة بخطوة)

Section titled “كيفية الاستخدام داخل مدير المحتوى في Strapi (خطوة بخطوة)”
  1. Invoke from Anywhere: Press Cmd+K (macOS) or Ctrl+K (Windows/Linux) while inside Content Manager or any plugin page.
  2. Filter by Entity Type, Status & Locale: Type a keyword and narrow results by Collection Type, Draft/Published status, or i18n locale badge.
  3. Open in Content Manager: Press Enter to open the entry in Content Manager in the current tab, or Cmd/Ctrl + Enter to open it in a new tab.

التزامن بين مدير المحتوى ومساحة عمل الإضافة

Section titled “التزامن بين مدير المحتوى ومساحة عمل الإضافة”

حالات الاستخدام داخل مدير المحتوى ومسارات العمل التحريرية

Section titled “حالات الاستخدام داخل مدير المحتوى ومسارات العمل التحريرية”

Content Manager Use Case 1 — Jumping Between Plugin Entities & Host Collections Without Leaving the Keyboard

Section titled “Content Manager Use Case 1 — Jumping Between Plugin Entities & Host Collections Without Leaving the Keyboard”
  • الغرض والأهمية: Switch from editing a Booking Resource to a Donation Campaign or Islam Scripture Entry in Content Manager in under a second.
  • خطوات التنفيذ في مدير المحتوى: Press Cmd+K, type the title or slug, and press Enter to load the target document in Content Manager.

5. حالات الاستخدام ومسارات العمل المتكاملة

Section titled “5. حالات الاستخدام ومسارات العمل المتكاملة”

Use Case 1 — Instant Cmd+K / Ctrl+K Spotlight Navigation Across All Entities

Section titled “Use Case 1 — Instant Cmd+K / Ctrl+K Spotlight Navigation Across All Entities”
  • What it is for: Jump directly to any Article, Course, Event, Booking, Certificate, or Single Type record from anywhere in Strapi Admin without leaving the keyboard.
  • How it works: Press Cmd+K, type a query (e.g., islam), navigate with ↑/↓, and press Enter to open the document in Content Manager (or Cmd/Ctrl + Enter for a new tab).

Global Command Search — Spotlight Cmd+K Command Palette

Use Case 2 — Deep Component & Multilingual Script Search (Arabic, Turkish, Spanish)

Section titled “Use Case 2 — Deep Component & Multilingual Script Search (Arabic, Turkish, Spanish)”
  • What it is for: Find records by text buried inside repeatable components, SEO meta descriptions, or Arabic/RTL localized variants.
  • How it works: GET /global-search/search?q=...&locale=all normalizes diacritics and Arabic Alef/Teh Marbuta variants and searches both top-level and nested component fields.

Global Command Search — Strapi v5 Admin Workspace

Use Case 3 — Tabbed Search Behaviour & Per-Content-Type Inclusion Tuning

Section titled “Use Case 3 — Tabbed Search Behaviour & Per-Content-Type Inclusion Tuning”
  • What it is for: Fine-tune query thresholds (Minimum characters, Debounce (ms), Results per content type, Maximum results, Component depth, Query timeout (ms), Search inside components, Include drafts, Include plugin content types) and toggle which Content-Type entities appear in global search.
  • How it works: Configure the Search behaviour and Content types tabs in /admin/settings/global-search (PUT /global-search/settings).

Global Command Search — Strapi v5 Settings Panel

6. نقاط النهاية البرمجية REST API (content-api و admin)

Section titled “6. نقاط النهاية البرمجية REST API (content-api و admin)”
الطريقة مسار نقطة النهاية النطاق المعالج (Handler) المصادقة
GET /global-search/search admin search.find Bearer JWT
GET /global-search/schema admin schema.find Bearer JWT
GET /global-search/schema/all admin schema.findAll Bearer JWT
GET /global-search/settings admin settings.find Bearer JWT
PUT /global-search/settings admin settings.update Bearer JWT
POST /global-search/settings/reset admin settings.reset Bearer JWT

7. الاستخدام البرمجي داخل الخادم (strapi.plugin و strapi.documents)

Section titled “7. الاستخدام البرمجي داخل الخادم (strapi.plugin و strapi.documents)”
// Registered services on plugin "global-search": "schema", "query", "ranking", "permissions", "settings", "search"
const pluginService = strapi.plugin("global-search")?.service("schema");
// Retrieving plugin settings via Strapi plugin store
const store = strapi.store({ type: "plugin", name: "global-search" });
const settings = await store.get({ key: "settings" });

8. استكشاف الأخطاء والتحقق من الجودة

Section titled “8. استكشاف الأخطاء والتحقق من الجودة”
  • عدم ظهور التغييرات في لوحة الإدارة: قم بتشغيل pnpm strapi build بعد تعديل ملف config/plugins.ts.
  • عزل حزم Strapi: حافظ على إعداد hoistPattern: ["*", "!@strapi/*"] داخل pnpm-workspace.yaml لمنع تكرار سياق React.
  • فحص الأنواع الصارم (TypeScript): قم بتشغيل pnpm check للتحقق من سلامة حزمتي الواجهة والخادم.