انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-068-L05

الحداثة: إعادة الفهرسة عند الأحداث

  • الدرس 5 من 8
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

keep the index current by re-embedding only what changed.

الموضوعات المخطط لها

  • Nightly full rebuilds are slow, costly, and leave answers stale for hours.
  • Event-driven: HelpArticleUpdated (via the outbox, see messaging modules) triggers re-chunking and re-embedding of that article.
  • Compare a content hash per chunk and skip unchanged chunks to save embedding calls.
  • Replace chunks atomically (delete old, insert new in one transaction); handle HelpArticleDeleted too.
  • Handlers must be idempotent: the same event twice gives the same index.
تفاصيل المخطط المبدئي

عرض عملي

event HelpArticleUpdated{articleId:42, version:7} → consumer → chunk → hash compare → embed 2 changed chunks → transaction replaces rows of article 42.

اختبر فهمك

Why make the re-index handler idempotent?

أظهر الإجابة

Events can be delivered more than once.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.