---
title: "Keep search indexes in step · Agent Wranglers"
url: https://agentwranglers.se/playbook/data/caches-and-copies/search-index-sync
updated: 2026-10-20
licence: "All rights reserved"
---

# Keep search indexes in step

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Caches and copies](https://agentwranglers.se/playbook/data/caches-and-copies)
- Rule: Update the search index from the source of truth through a reliable queue, and rebuild it fully on a schedule.
- How: Write index updates to an outbox table in the same transaction as the change, as the [outbox rule](https://agentwranglers.se/playbook/data/transactions-and-concurrency/outbox) describes. A worker applies them. A periodic full rebuild repairs anything that drifted.
- Check: Delete a product. Within the stated delay it disappears from search, and a full rebuild finds no differences.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers data playbook: https://agentwranglers.se/playbook/data/caches-and-copies/search-index-sync`.

- Previous: [Read from replicas only what may lag](https://agentwranglers.se/playbook/data/caches-and-copies/replica-lag)
- [Caches and copies](https://agentwranglers.se/playbook/data/caches-and-copies)
