A search box is not proof that a write is already searchable. I therefore draw the index pipeline from write through to query before a team treats the index as a mirror of the database: the path a document takes, where it is transformed, and the moment it becomes visible to a query. We make ByteDiagram ourselves, and I leave the product until the short tool section at the end.
This post is about that pipeline, not about whether a particular engine should be added. The boxes stay useful in Elasticsearch or in another engine that uses the same stages. This post uses Elasticsearch as the example because Elastic documents the write-to-query path in public detail; it is not an endorsement. What the pipeline is for, ahead of picking a product, is the subject of why I diagram a data pipeline first.
Why write and query need to share one page
A common sketch is a database, an arrow, and a search box. That picture hides the work in the middle, and it hides a delay that is easy to misread as a bug. A document can be accepted by the index and still be invisible to search until a later step makes a new segment searchable. Elastic's documentation on near real-time search describes this for Elasticsearch: when a document is stored, it is indexed and fully searchable in near real-time — within one second by default. Near real-time is not the same as immediately. If the diagram omits the refresh step, people will blame the wrong box when a write succeeds and a hit is missing.
The boxes I put on the page
I draw the path left to right, in the order a document moves:
- The source of truth, usually the application database or an event-sourced store that already owns the record.
- The writer, which sends a document into the index pipeline.
- Ingest and analysis, where the document may be transformed and its text broken into searchable terms.
- The index itself, as segments that together make an inverted index.
- Refresh, the step that makes recent operations visible to search.
- The query path, which reads only what refresh has already made visible.
I keep the source of truth and the index as separate boxes. The index is a derived view, optimized for finding things, not a second official record unless a team has explicitly chosen that — and if they have, the diagram should say so.
When the source of truth is an event store, this pipeline is a projection on an event sourcing architecture diagram. I link there rather than redrawing the command side.
Ingest is a pipeline, not a silent arrow
Elastic's ingest pipeline documentation is a clear description of this stage. An ingest pipeline lets you transform data before indexing: remove fields, extract values from text, enrich a document. Processors run sequentially, and when they finish Elasticsearch adds the transformed document to the data stream or index.
Two limits from that same page belong on the diagram, so ingest does not grow into a fantasy platform. Pipelines operate on one document at a time as it is indexed. A pipeline can transform or drop a document, but it cannot split one incoming document into several, and it cannot read or aggregate across other indexed documents, except an enrich processor that looks up an enrich index. A pipeline also runs at index time; it does not change documents already in the index unless you reindex or update by query with a pipeline.
I draw ingest as a short row of example processors, with a note on those limits: one document at a time, and no split or aggregate except enrich. I do not invent a processor list for an application I have not seen. Analysis sits in its own box, next to ingest or just after it, as the step that turns text into terms the inverted index can store. Elastic notes that in most cases the same analyzer should be used at index and search time, so the query side has to turn text into the same tokens, or the hit will not come back.
The index is segments, and refresh opens the latest ones
Elastic's near real-time page is the source for this middle stretch.
Lucene, the library Elasticsearch is built on, searches per segment. A segment is similar to an inverted index; in Lucene, an index is a collection of segments plus a commit point. Documents first sit in an in-memory indexing buffer, then are written to a new segment. That new segment is written to the filesystem cache first, which is cheap, and only later flushed to disk, which is expensive. Lucene can then open the segment for search without a full commit to disk. In Elasticsearch, that lighter process is called a refresh. A refresh makes all operations performed on an index since the last refresh available for search.
Elastic's docs say that, by default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds. That is why the system is called near real-time: changes become visible within that timeframe, not immediately. I put those timings on the refresh box, attributed. Elastic's refresh API documentation notes that in Elastic Cloud Serverless the default refresh interval is 5 seconds across all indices. If a team is on that platform, the number on the diagram should follow those docs, not the Stack default.
When a write must be searchable before the response returns
Sometimes a user writes and then immediately searches for the same document. Elastic's refresh parameter documentation describes the choices on the Index, Update, Delete and Bulk APIs.
The default is to take no refresh-related action; the change becomes visible at some point after the request returns. Setting refresh=true refreshes the relevant primary and replica shards immediately, which Elastic says should only be done after careful thought, because it is expensive and creates tiny segments that later have to be merged. Setting refresh=wait_for waits until a refresh happens before the request replies, without forcing one immediately. Elastic's Refresh API page recommends wait_for when a workflow indexes a document and then searches for it, and the refresh parameter page says to batch those waits rather than issuing them one after another.
I mark default, refresh=true, and refresh=wait_for in a note under the refresh step, not as three architectures. Most of the page should still show the default path, with wait_for as the exception.
The query only sees what is already visible
The query side of the page is shorter, on purpose. A query parser, a search against the segments currently open for search, and a ranked list of hits is enough. The important edge comes back from refresh: if a document is still in the in-memory buffer and has not been refreshed, the query box will not see it.
I also leave room for a cache in front of query. For the layers a request can hit before it reaches a store, see how I diagram a caching layer before slow pages reach users. Retrieval-augmented generation is a neighbour, not a synonym: a RAG architecture diagram covers retrieval into a model prompt, which may use this index or something else.
Keep one writer in charge of the document
One way this pipeline drifts is to have two writers. The application writes to the database, then a second, independent write tries to send the same change to the index. If one write succeeds and the other fails, the index and the source of truth no longer agree, and the diagram had no place to show the disagreement. I only draw a single responsible writer, preferably one that follows from the source of truth: a projection updated from the same events, a change stream, or a job that reads committed state and then indexes it. The page should show that the index is downstream, and that a retry is safe if the same document is sent twice. If the upstream system is event sourced, this is the projection lag already marked on the event sourcing page; the search pipeline starts where that projection hands a document to ingest.
What stays off the diagram
Comparison tables from vendors do not belong here. Neither do invented query rates, unmeasured tail latencies, or cluster sizes. Elastic's docs explain refresh and ingest; they do not describe your index. Shard counts, replica counts and analyzer names go on the page only when they are real for the system being drawn.
Elastic's refresh API documentation already calls refresh resource-intensive and recommends waiting for the periodic refresh when you can. That is a note, not a capacity plan.
ByteDiagram notes for write-to-query
These ByteDiagram panels were checked in the guest canvas on 12 November 2026; the export line is from our 19 Oct 2026 check.
Templates ("Start from a template") includes "Web App Stack" and "Microservices" quick starts that give a first layout for the source of truth and the writer. Icons are grouped as Databases, Messaging & Streaming, AWS Services, Azure and Google Cloud, which covers the database, any stream, and the usual cloud marks. A "Section", which the panel calls a "Dashed zone for grouping steps", can surround the index and refresh step, and "Auto-arrange" straightens boxes after edits.
Timeline fits when the confusing part is the order of a write, ingest, and the refresh that finally opens the document to a query; drag the bars until that sequence is visible, then Play, Pause, or loop playback to run it again. Here the accepted write plays first, then the refresh, then the query that can at last see the document. After the path is in place, its Export menu includes PNG, SVG and Animated GIF (checked 19 Oct 2026). A still image usually serves a review; animation helps only if readers still invert that order. A trial needs no account: the guest canvas top bar reads "Local only". The step-by-step of playing a diagram in order is in how to animate an architecture diagram step by step, when only the animation controls are still unclear.
FAQ
What is a search index pipeline diagram?
It is one page that shows how a document moves from the source of truth to a query: the writer, ingest and analysis, the index segments, the refresh that makes new work searchable, and the query path that can only see what has already been refreshed.
Why can a write succeed and a search still miss the document?
Because acceptance and visibility are different steps. In Elasticsearch, a refresh makes operations since the last refresh available for search. Until that refresh happens, a successful index request can still be invisible to queries. Elastic describes this as near real-time search, not immediate search.
Should every index request force a refresh?
The default, and the fastest choice, is to omit the refresh parameter. Elastic's Refresh API page recommends refresh=wait_for when the same workflow must search for the document it just wrote. Use refresh=true only after checking the cost, because it forces an immediate refresh and can create tiny segments.
How is this different from a diagram that decides whether to add a search engine?
This page starts after that decision, or beside it. It maps the write-to-query path inside the index pipeline. It does not argue for or against adding a particular engine, and it keeps the source of truth and the index as separate boxes so the pipeline is visible.
Sources
Checked on 15 November 2026.
- Elastic, Near real-time search: per-segment search, the in-memory buffer, refresh, the default one-second interval, and the 30-second search-traffic condition.
- Elastic, The refresh parameter: the default of no refresh action,
refresh=true, andrefresh=wait_for, the tiny-segment cost oftrue, and batching wait_for requests. - Elastic, Refresh an index: refresh makes recent operations searchable, the note that refreshes are resource-intensive, and the Elastic Cloud Serverless default of 5 seconds, and the recommendation to use refresh=wait_for when a workflow indexes then searches.
- Elastic, Ingest pipelines: sequential processors that run before a document is added to an index, and the limit that a pipeline works on one document at a time.
- Elastic, Index and search analysis: in most cases the same analyzer should be used at index and search time.
- ByteDiagram team: Rahish is named there as Founder & CEO.
- ByteDiagram guest canvas: panel names (Templates, Icons, Section, Auto-arrange, Timeline) verified 12 November 2026, and the Export menu items verified 19 October 2026.
Draw the path from write to query
Pick one document type you already index and draw the source of truth, the writer, ingest, the segments, refresh, and the query. Mark when a write becomes searchable, keep a single writer, and if a number is unknown, leave that cell empty rather than invent it.
Map the write-to-query path on one page
Open ByteDiagram — it is ours — and place the source of truth, the writer, ingest, index segments and refresh on a single sheet, mark the near-real-time gap with a dashed section, then export a still PNG or SVG for the review pack.
Visit ByteDiagram