Query enrichment adds semantic information to a parsed query before retrieval. In a semantic search pipeline, parsing extracts entities and relationships, enrichment interprets them, transformation rewrites the query for recall and ranking, and searching executes it. section 7.4
Enrichment can attach relevance learned from user interactions, topic classifications, related terms, synonyms, misspellings, signal boosts, personalization data, or embedding vectors. The useful combination depends on the search domain rather than on one universal recipe. section 7.4.2
A practical implementation separates enrichment into two complementary mechanisms:
- Semantic functions apply dynamic rules to query-tree nodes, such as interpreting “popular” as a popularity boost or “near” as a geographic filter. section 7.4.2
- A semantic knowledge graph supplies related terms and classifications for unknown keywords, then stores those enrichments on the corresponding entity. section 7.4.2
- Canonical-form mappings and additional entity fields let the same pipeline add alternate representations, boosts, classifications, related terms, or vectors. section 7.4.2
Semantic Function Entities
+-------+-------------------+----------+----------------------------------+
|surface|canonical_form |popularity|semantic_function |
+-------+-------------------+----------+----------------------------------+
|near |{location_distance}|90 |location_distance(query, position)|
|in |{location_distance}|100 |location_distance(query, position)|
|by |{location_distance}|90 |location_distance(query, position)|
|by |{text_within_on...}|10 |text_within_one_edit_distance(...)|
|near |{text_distance} |10 |text_distance(query, position) |
|popular|{popular} |100 |popularity(query, position) |
|top |{popular} |100 |popularity(query, position) |
|best |{popular} |100 |popularity(query, position) |
|good |{popular} |100 |popularity(query, position) |
+-------+-------------------+----------+----------------------------------+
Use the semantic-function table to inspect how surface forms map to canonical functions, including location, popularity, and text-distance interpretations. section 7.4.2
Turning query language into search constraints
A query containing “popular” can be rewritten into a Solr function that boosts documents using star ratings. A query containing “near” or “by” can consume the following city entity and replace both terms with a geographic filter around that city. The query tree is processed node by node; unsuccessful semantic functions become invalid rather than silently changing the query. section 7.4.2
A second path enriches keyword nodes through a semantic knowledge graph, retrieving related terms and document categories before marking the node as enriched. This keeps enrichment extensible: new models can add fields without replacing the parsing framework. section 7.4.2
