liveBook · Manning

Query vector

As explained in AI-Powered Search

A query vector is an ordered collection of feature values representing the factors used to calculate a query-dependent relevance score.

A query vector is an ordered collection of feature values used to calculate a query-dependent relevance score. It lets a search pipeline combine keyword relevance with signals such as location, freshness, and popularity instead of sorting by one feature alone. section 3.2.2

A practical query vector can contain:

  • BM25 keyword relevance, where higher values improve the score. section 3.2.2
  • Geographical distance, where nearer documents score better. section 3.2.2
  • Publication date, where newer documents score better. section 3.2.2
  • Popularity, where higher values score better. section 3.2.2

Combining four ranking signals

Scale each feature between 0 and 25, then add the weighted values. A document scoring 25 for keyword relevance, distance, freshness, and popularity reaches the nominal perfect score of 100. Adjusting a feature's contribution changes its influence without changing the other signals. section 3.2.2

Solr request syntax:
 {"query": "{!func}scale(query($keywords),0,25)
     {!func}recip(geodist($lat_long_field,$user_latitude,
     $user_longitude),1,25,1)
     {!func}recip(ms(NOW/HOUR,modify_date),3.16e-11,25,1)
     {!func}scale(popularity,0,25)",
  "params": {"keywords": "basketball",
             "lat_long_field": "location",
             "user_latitude": 33.748,
             "user_longitude" -84.391}}

Inspect a Solr function query that combines scaled keyword relevance, reciprocal geographical distance, freshness, and popularity. section 3.2.2

How AI-Powered Search covers it

How deep it goes
Explains feature selection, 0-to-25 scaling, score addition, and manual weights, but defers automatic tuning to learning to rank.
Examples
Uses a Solr query combining keyword relevance, distance, freshness, and popularity.
What it assumes
Assumes search-ranking familiarity while explaining feature comparability and weighting directly.
What you can do after
Apply it via Solr function queries to construct and manually tune multi-signal relevance scores.
How it connects
Connects BM25, geographical distance, publication date, popularity, function queries, and learning to rank.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Search. The section links point to the parts of the book it draws on.