Goal
Understand how Lucidworks Fusion calculates document scores during a search and how to interpret the parsedquery and debug output returned by Solr.
Environment
Fusion 4.2.6 and above
Solr 7.7.3 and above
Guide
Review document scoring logic
Fusion leverages Apache Solr’s scoring mechanisms, including BM25 (default) and TF-IDF (legacy), to compute how well documents match a given query. The score of each result is determined by a combination of:
Term frequency (TF): How often a term appears in a document
Inverse document frequency (IDF): How common or rare a term is across all documents
Field length normalization
Field-specific boosts
Function-based boosts
You can view this scoring breakdown by appending the following parameter to your query:
debugQuery=onThis returns detailed scoring logic under the explain section of the response.
Understand the parsed query
Fusion uses Solr’s query parsers (typically edismax) to transform input text into a structured query. This can be viewed using the parsedquery parameter in the debug output.
To inspect this:
Submit a query using Fusion’s Query Workbench or directly to Solr with
debugQuery=on.Look for the
parsedqueryfield in the response JSON.The value shows the actual Solr syntax that will be used, including any boosts, tokenization, and field matching.
Example:
"parsedquery": "+(title:otolaryngology^2.0 body:otolaryngology)"This indicates that the term "otolaryngology" is being searched in the title and body fields, with a boost applied to the title field.
Apply field boosts using the Additional Query Parameters stage
To influence scoring and document ranking, configure boosts in the Query Pipeline using the Additional Query Parameters stage. Boosting allows certain fields or values to carry more weight.
Example boost using the bq parameter:
"bq": "category:food^10 category:deli^5"This tells Solr to favor documents with category:food (boosted 10x) and category:deli (boosted 5x).
Reference: Solr dismax query parser - bq parameter
Use function queries to apply dynamic scoring
Function queries can boost documents based on numeric fields or other calculated values. Use the bf (boost function) or boost parameter.
Examples:
"bf": "recip(ms(NOW,publish_date),3.16e-11,1,1)"
"boost": "log(popularity)"Reference: Solr function queries
Interpreting the score explanation
When debugQuery=on is set, the explain field will include a nested breakdown of how a score was computed. Look for key elements:
weight(...)indicates field-level matchingidf,tfNorm, andboostshow the influence of frequency and boostingFinal score is a product of these components
Sample excerpt:
37328.297 = product of:
1.0 = boost
37328.297 = product of:
685.3077 = sum of:
4.8803904E-5 = weight(Synonym(_text_:otolaryngology))
...
685.3076 = weight(filter_page_type_ss:Service & Specialties)^200
This example shows a document heavily boosted due to a match in filter_page_type_ss with a field-level boost of ^200.
Understanding this breakdown helps identify why certain documents rank higher than others and whether boosts or schema changes are needed.