Skip to content

PATTERN Cited by 2 sources

Edit-quiescence indexing

Edit-quiescence indexing is the indexing-trigger pattern of delaying index updates until a document has been stable — no edits — for a wall-clock threshold (Figma: 4 hours). The delay window trades bounded freshness lag for two benefits: unfinished work stays out of results, and index-update load is reduced / smoothed.

Intent

Two observations about search over user-authored content:

  1. Most WIP is noise. Designers, writers, and engineers iterate on documents. Intermediate states (half-drawn UI frames; stub pages; draft prose) are not what other users want to find. A purely-reactive indexer ingests those intermediate states and surfaces them, inflating "found but not useful" results.
  2. Churn is expensive and wasteful. Each edit to a live document triggers re-indexing. For corpus shapes where edits cluster in sessions (most design/doc work), reactive indexing re-encodes the same content N times before the session ends, with only the final state actually useful.

Solution: introduce a quiet-period buffer. The document is indexed only when the system has waited out the user's editing session.

Mechanism

Basic shape:

on_edit(doc):
    schedule(index(doc), after=QUIESCENCE_THRESHOLD)
    cancel_prior_scheduled_indexes(doc)

Each new edit resets the timer. The indexer fires only after QUIESCENCE_THRESHOLD passes without any intervening edit. Figma's canonical threshold: 4 hours (Source: sources/2026-04-21-figma-how-we-built-ai-powered-search-in-figma).

"One quick fix was to hold off on indexing designs until we knew that a designer was done tinkering; we'd only index once a file hadn't been edited for four hours. That approach kept unfinished work out of search results and increased the chances of surfacing completed designs. It also eased the load on our systems."

Why this works

  • Session-shaped workloads. Design / writing sessions often last ~hours and end naturally (end of day, decision to ship, handoff). A 4h window is tuned to catch "done for now" without making users wait excessively.
  • Bounded staleness. The freshness guarantee is simple to reason about: at most QUIESCENCE_THRESHOLD stale after the last edit. Predictable and communicable.
  • Load smoothing. Work done once at the end of a session instead of N times during it cuts index-update cost proportionally to the average session-edit-count. Figma's companion infrastructure post quantifies this directly: "we discovered by looking at the data that if we debounced indexing to be at most every four hours, we would only have to process 12% of the data!" — roughly load reduction just from the quiescence window (Source: sources/2026-04-21-figma-the-infrastructure-behind-ai-search-in-figma).

Design questions

  1. What threshold? Too short → WIP leaks; too long → product feels stale. Figma's 4h is opinionated; different products (code search vs design search vs chat search) will tune differently.
  2. Session boundaries. Do you reset the timer on any edit or only substantive edits? (E.g. cursor movement vs structural change.) Figma doesn't disclose this detail.
  3. Immediate-indexing escape hatches. Is there a "publish" / "share" / "mark ready" action that bypasses the quiescence window? Useful when the product has an explicit done-ness signal, avoids forcing users to wait.
  4. Deletion / archive events. Edit-quiescence only guards writes. Deletes and archives probably shouldn't wait 4h.
  5. Cold-start population. For a corpus being bulk-indexed the first time, the quiescence window is moot — use a different code path.

What it does not fix

  • Long-abandoned drafts. A file edited once and never touched crosses the 4h bar and gets indexed — the quiescence trigger alone doesn't distinguish "recently stable" from "abandoned forever." Pair with patterns/selective-indexing-heuristics (e.g. quality signals, explicit archive flags) to catch abandoned / archive-tagged content.
  • Content-quality problems. A WIP-polished-but-useless design still gets indexed once stable. Quiescence filters timing, not merit.

Caveats

  • Perceived staleness in tight-feedback-loop queries. A designer who just saved a frame and immediately searches for it won't find it for 4h. Product must either surface the user's own recent work through a different path or communicate the delay.
  • Clock domain. "4h no edits" requires the indexer to track last-edit timestamps reliably across pause/resume, offline edits, time-zone-hopping users. Edge cases proliferate.
  • Not a substitute for selective indexing. Edit-quiescence filters when, selective indexing filters what / whether. Both are needed — see patterns/selective-indexing-heuristics.

Relationship to other patterns

  • patterns/selective-indexing-heuristics — the content- shape complement: filters by what's worth indexing at all. Edit-quiescence filters by when to index it. Stack both.
  • concepts/feature-freshness — the ML-inference-side concept that governs how fresh a feature value must be for the downstream model to work. Edit-quiescence is an analogous freshness policy on the search-index side: search freshness bounded by the threshold.

Seen in

Last updated · 200 distilled / 1,178 read