03 / Search indexes · General technology reading
Find the word, then the document
A search box can make finding a document feel immediate. Much of the work happens earlier, when text is prepared and organized into an index that can be consulted when a query arrives.
window → documents A, BThe index points to documents containing each term.
Prepare the words
Search software often divides text into tokens and applies rules that make comparisons useful. Those rules might treat uppercase and lowercase letters alike, or relate selected word forms. The choices affect which queries can match a document.
An index can reverse the usual reading direction: instead of opening each document and inspecting its words, a lookup starts with a term and finds associated documents. This is the central idea of an inverted index. It reduces repeated scanning, though building and updating the structure still takes work.
A match is a candidate
In the hypothetical specimen above, searching for window could find both documents. The index alone does not explain which one best answers the reader. Ranking rules can use further information, such as where a term appears or how common it is in the collection.
Useful results depend on the question. Searching for an exact identifier requires precise characters, while exploring a broad subject may call for related wording. One configuration may not serve both intentions equally well.
Read beyond the result
A result list is a route into information, rather than a guarantee that the information is complete, current or correct. A document can be absent because it has not been indexed, because its text could not be extracted, or because access rules exclude it.
For a surprising result, try a distinctive term and check which collection is being searched. Read the document before relying on its preview. This website uses a direct reading directory, so every topic is accessible without a search box.
Further reading: Elastic: how full-text search works. An external educational reference.