Module 3 · Lesson 6 of 7

Keeping the index up to date

When a page changes

An edited page reaches the index as an event: the indexer replaces that page's chunks, so answers follow the change within minutes.

Scene 1 of 5 · The policy changes

At 09:00 someone edits the help page: refunds now close after 14 days, not 30.

Help pagesHelp pagesrefunds: 14 daysChange eventsChange eventsIndexerIndexerVector indexVector indexstill says 30
  • Help pages — healthy — refunds: 14 days
  • Change events — healthy
  • Indexer — healthy
  • Vector index — healthy — still says 30
  1. The policy changes. At 09:00 someone edits the help page: refunds now close after 14 days, not 30.
  2. Wait for the night. A rebuild at 02:00 leaves the old 30-day answer live for 17 hours.
  3. One event per edit. Instead, the edit puts an event on a queue, and the indexer picks up only that page.
  4. Replace, not add. It deletes the page's old chunks and writes the new ones, about 1 minute after the edit.
  5. Keep one model. Switching embedding models needs a second index, filled from every page, before searches move to it.
  6. Now you try. Pick a way to keep the index up to date, and see what a refund question finds at noon. For example: It finds: only the old 30-day chunk. Out of date for 17 hours. The change waits for the 02:00 rebuild, so the old answer stays live for 17 hours.

Scene 1 of 5: The policy changes. At 09:00 someone edits the help page: refunds now close after 14 days, not 30.

Key points

  1. A nightly rebuild leaves changed facts wrong for most of a day.
  2. An event per edit lets one worker re-index only that page.
  3. Replacing a page means deleting its old chunks, not only adding new ones.
  4. A new embedding model means re-embedding every page before switching.

Documents change: a price goes up, a policy changes, a page is deleted. The must follow, or search keeps finding the old text and the model answers from it.

Rebuilding the whole index on a timer is simple but slow to catch up. A common design sends an event for each edit through a , and a worker re-chunks and re-embeds only that page.

An update must replace, not add: delete the page's old , or both versions stay findable. Storing each chunk's page and version makes this easy.

from two models cannot be compared. Changing the model means re-embedding every page into a new index, then switching searches over.

Example. Example times: the refund window drops from 30 to 14 days at 09:00. A nightly rebuild at 02:00 serves the old answer for 17 hours; a change event updates the index in about a minute.

In system design: Index updates are a data : events, a queue, workers and deletes. Measure how far the index lags behind its sources.

Check yourself

A help page is edited, and the indexer adds its new chunks but keeps the old ones. What can go wrong?