Every time you type a few words into a search box and hit enter, a hidden decision is being made behind the scenes: how should the system decide which documents to show you? Should it return only the records that contain your exact words, or should it try to guess what you really meant and rank the closest matches first? This single question separates the major families of search techniques used in information retrieval (IR). In this post we will walk through three of them – exact match, best match, and partial match – and see how each one shapes the results you get from library catalogues, databases, and search engines.
Table of Contents
- What “searching” really means in information retrieval
- Exact match search
- How a Boolean query is processed
- Where exact match works well
- The limitations of exact match
- Best match search
- The vector space model
- Probabilistic models and BM25
- Why best match wins for everyday searching
- Partial match search
- Stemming and truncation
- Wildcards and approximate string matching
- N-grams for chunk-level matching
- Relevance feedback and query expansion
- Choosing the right technique
What “searching” really means in information retrieval
Searching is the process of comparing a user’s query against stored documents and deciding which ones to return. The catch is that queries are rarely perfect. They often retrieve some irrelevant documents while missing other relevant ones. IR systems are therefore judged on two measures: precision (how many of the retrieved documents are actually relevant) and recall (how many of the relevant documents in the collection were actually retrieved). Almost every search technique is a trade-off between these two goals.
Retrieval models are commonly grouped into two broad approaches. The Boolean model is based on the “exact match” principle, while the vector space and probabilistic models are based on the “best match” principle. Understanding this split is the key to understanding how modern search works.
Exact match search
Exact match searching retrieves only those documents that precisely satisfy the conditions stated in the query. It is most commonly implemented through the Boolean model, where a query is a logical expression built from index terms and the operators AND, OR, and NOT. The system retrieves every document that satisfies the logical expression and rejects the rest. There is no middle ground.
How a Boolean query is processed
Suppose a student searches an academic database for “digital library” AND metadata. The system looks up each term in its inverted index – a data structure that maps every term to the list of documents containing it – and then combines the two lists. With the AND operator, only documents appearing in both lists are returned. With OR, the lists are merged; with NOT, documents containing the excluded term are removed. The result is a clean partition of the collection into a “matched” set and an “unmatched” set.
Where exact match works well
Exact match shines when precision matters more than anything else. It is ideal for known-item searches, where you already know an author, title, or ISBN, and for structured data retrieval in fields that use controlled vocabulary, such as a library OPAC or a legal database. Lawyers running e-discovery and librarians filtering catalogue records still rely on it precisely because the logic is deterministic and the reasons for retrieval are transparent. It is also computationally simple and fast.
The limitations of exact match
The same rigidity that makes exact match precise also makes it brittle. The model offers no ranking of documents and no notion of partial matching, and it frequently returns either too few or too many results. There is no allowance for synonyms, so a search for “automobile” will simply miss documents that say “car”. Spelling errors break the search entirely. And many users find it genuinely difficult to translate an information need into a correct Boolean expression, especially as the query grows complex. These shortcomings – poor recall, no relevance ranking, and a steep learning curve – are exactly what the next family of techniques was designed to solve.
Best match search
Best match searching abandons the idea of a hard yes-or-no decision. Instead of partitioning documents into relevant and irrelevant, it assigns every document a relevance score and ranks them from most to least likely to satisfy the query. This is the approach you experience on almost every web search engine and discovery service today. You can type a plain natural-language query without any operators, and the system pushes the most promising results to the top.
The vector space model
One of the foundational best match models is the vector space model, which represents documents and queries as vectors so that the distance between vectors reflects their relevance. Each unique term in the collection becomes a dimension. A document that uses certain terms heavily points in the direction of those dimensions, and so does a query. The system then measures the cosine similarity – the cosine of the angle between the query vector and each document vector. A smaller angle means a closer match, so documents are ranked by their cosine score. Terms can also be weighted using schemes like TF-IDF, so that distinctive words count more than common ones.
Probabilistic models and BM25
A second major best match approach is the probabilistic model, which ranks documents by the estimated probability that they are relevant to the query. The most influential member of this family is BM25, short for “Best Matching 25,” a probabilistic framework that builds on the vector space and probabilistic models to score documents by the frequency and distribution of query terms. It is the default ranking function in many open-source search engines and library discovery layers.
BM25 works by balancing three factors. Term frequency rewards documents where query terms appear often, but with diminishing returns so that repetition cannot dominate. Inverse document frequency weights terms by how rare they are across the collection, and document length is normalised so that long documents are not unfairly favoured. The result is a nuanced score that handles real-world queries far better than a simple keyword count.
Why best match wins for everyday searching
Best match offers several practical advantages. Results are ranked by relevance, so the most useful documents appear first even when thousands of records match. It tolerates vocabulary mismatch, accepts simple natural-language queries, and adapts equally well to specific lookups and open-ended exploration. For a student who is unsure of the exact terminology used in a field, this forgiving behaviour is invaluable. The price paid is some loss of precision and a heavier computation load, but for large, messy collections that trade-off is almost always worth it.
Partial match search
Partial match techniques sit between the two extremes. They are designed to find documents even when the query and the document do not share identical word forms. Rather than being a single model, partial match is a toolkit of techniques layered on top of exact or best match systems to widen recall.
Stemming and truncation
One of the oldest partial match tools is stemming, a procedure that reduces words with the same root to a common form so that “stemmer,” “stemming,” and “stemmed” all collapse to “stem.” The most widely used algorithm is the Porter stemmer, which Porter himself stated reduces the initial vocabulary by about a third. Stemming is mainly a recall-enhancing device: by conflating word variants it lets a query fetch related forms a user might not have typed. A related manual technique is truncation, where a searcher types a word stem followed by a wildcard symbol – for example educat* to catch educate, education, and educator at once.
Wildcards and approximate string matching
Wildcard searching lets users place symbols inside or at the end of a term to stand in for unknown characters. More sophisticated still is fuzzy matching, which finds strings that only partially match the query rather than requiring an exact one. As one practical guide explains, fuzzy matching is especially useful when users misspell words or enter partial terms, and it measures similarity using an edit distance that counts the minimum changes needed to turn one string into another. Common metrics include Levenshtein, Hamming, and Jaro distances. This is what lets a search box quietly correct “libary” to “library.”
N-grams for chunk-level matching
Another important technique breaks strings into small overlapping chunks. The n-gram approach splits strings into smaller pieces and compares them to detect partial matches, an approach widely used in search engines and text analytics. For instance, converting “sarit” into 3-grams produces the set “sar,” “ari,” and “rit.” Two strings can then be judged similar if they share enough n-grams, which makes the method robust to typos and partial inputs without needing a perfect match.
Relevance feedback and query expansion
Partial match also operates at the level of the whole query. With relevance feedback, the user marks some returned documents as relevant, and the system reformulates the query to look more like them. Relevance feedback and query expansion are designed to overcome the problem of a query missing documents that use different words, such as aircraft, airplane, or jet, which directly affects recall. Query expansion adds synonyms and related terms automatically. These methods can boost recall significantly, though they carry a risk of query drift, where an over-expanded query wanders away from the original information need.
Choosing the right technique
No single technique is best for every situation. Exact match is the natural choice when you know precisely what you want and need maximum precision, as in legal or known-item searches. Best match is the workhorse of large-scale discovery, where ranking and forgiveness matter most. Partial match techniques are the connective tissue that improves recall in both, catching the spelling slips, word variants, and vocabulary gaps that would otherwise cause relevant documents to slip through. In practice, modern systems blend all three – using fuzzy candidate generation, then BM25 or vector scoring to rank the survivors.
What do you think? When you search a library catalogue or database, would you rather have a precise but rigid Boolean filter or a forgiving ranked list that guesses your intent? And as fuzzy and semantic techniques get better at interpreting queries, do you think the disciplined skill of writing a clean Boolean search is still worth teaching?
References
- https://arxiv.org/pdf/2004.02256
- https://en.wikipedia.org/wiki/Boolean_model_of_information_retrieval
- https://en.wikipedia.org/wiki/Vector_space_model
- https://milvus.io/ai-quick-reference/what-is-the-role-of-bm25-in-fulltext-search
- https://adasci.org/blog/understanding-okapi-bm25-a-guide-to-modern-information-retrieval
- https://files.eric.ed.gov/fulltext/EJ1020841.pdf
- https://www.sciencedirect.com/topics/computer-science/query-expansion
- https://www.analyticsvidhya.com/blog/2021/07/fuzzy-string-matching-a-hands-on-guide/
- https://aerospike.com/blog/fuzzy-matching/
- https://www.cl.cam.ac.uk/teaching/1718/InfoRtrv/handouts/lecture7-relevance-feedback.pdf

Leave a Reply