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
