Repair Search Index Drift

    by Mariusz Wrzeszczynski

    1

    Repair search indexes that contain missing, stale, duplicated, or deleted records and add safe reconciliation and rebuild controls.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLIVVS CodeWWindsurfMManus+14 more

    See it in action

    You say

    Our Elasticsearch index is missing about 5% of our Postgres records after a worker crash. Can you reconcile the drift and fix the indexing pipeline to prevent this from happening again?

    Your agent does

    I detected 412 missing documents and 18 stale versions. I have implemented a versioned indexing contract using your Postgres 'xmin' as a monotonic version and added a reconciliation script that detects drift. Missing records have been backfilled without downtime using a temporary index.

    What you get

    Identify and backfill missing database records in your search index.Implement monotonic versioning to stop old events from overwriting new data.Configure zero-downtime alias cutovers for safe index schema migrations.Clean up ghost documents left behind by failed hard or soft deletes.

    About this skill

    The problem

    Search results frequently fall out of sync with your database due to lost queue events, race conditions, or failed reindexing. Users see "ghost" results that were deleted or miss new records entirely because indexing updates were reordered or dropped.

    What it does

    • Detects missing, stale, and duplicate search documents by reconciling index state against your authoritative database.
    • Implements version-aware indexing to prevent older updates from overwriting newer data.
    • Automates safe, zero-downtime index rebuilds using alias-based cutovers and validation checks.
    • Repairs broken deletion logic by implementing stable tombstones and idempotent event processing.

    Frameworks & tools

    Elasticsearch, OpenSearch, Algolia, Meilisearch, and Typesense. Works with SQL and NoSQL databases using queues, transactional outboxes, or CDC pipelines.

    Why this beats prompting it yourself

    Generic prompts often suggest a full "delete and reindex," which causes downtime and ignores the root cause of drift. This skill enforces a versioned consistency model that handles specific edge cases like reordered events and partial bulk-update failures that basic prompts miss.

    Use cases

    • Fixing search results that stay stale after a database update or restore.
    • Removing deleted records that still appear in search results.
    • Implementing a transactional outbox to ensure every database change hits your index.
    • Migrating search mappings without losing data or risking downtime.

    Known limitations

    Requires an existing project workspace and access to both the database schema and search provider configuration. Cannot guarantee consistency if the database lacks a monotonic version or timestamp.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Creator

    Mariusz Wrzeszczynski
    Mariusz Wrzeszczynski

    109 skills on Agensi

    Frequently Asked Questions

    Popular in Data Engineering