A search for “pizza” is more likely to retrieve restaurant documents than car-rental documents. That surrounding content provides clues about what a term means. Distributional semantics uses this principle—the distributional hypothesis—that words appearing in similar contexts tend to have similar meanings. section 2.3
A search engine can construct contexts from matching document sets. Queries can select character patterns, nearby terms, or Boolean combinations; the resulting documents reveal associations that an isolated keyword cannot. Context can be examined at the level of phrases, fields, documents, document sets, and the corpus. section 2.3 section 2.7
Selecting a context
The query `(Microsoft OR MS) AND Word` selects documents containing “Word” alongside either “Microsoft” or “MS”. It gives “Word” a more specific document context than a search for that term alone. Likewise, `"VP Engineering"~2` matches nearby variants such as “VP of Engineering” and “Engineering VP”. section 2.3
Vectors provide another way to compare meaning. A sparse representation can give each indexed term a dimension marked present or absent. Dense embeddings instead use fewer dimensions to score shared attributes; cosine similarity can then sort items by similarity. For ranking, this offers a semantic signal beyond whether particular keywords occur or how often they occur. section 2.3 section 2.7
Figure 2.11 Similarity between embeddings. The cosine between vectors shows the items list sorted by similarity with “green tea”, with “cheese pizza”, and with “donut”.
Compare the similarity orderings for “green tea”, “cheese pizza”, and “donut” to see how embedding-based comparisons change with the item being searched. section 2.3
