Issue
When executing identical searches in Fusion, the order of results may change between queries even when using the same parameters and filters. This can occur when sorting by score, as multiple documents can receive identical scores.
Diagnosis
If the sort parameter only specifies score desc and two or more documents have the same score, Solr does not guarantee the order in which tied results are returned. The result ordering may change between queries, especially in distributed search environments.
Environment
Fusion (any version)
Cause
Solr’s score value is not always unique among returned results. When multiple documents have identical scores, the tie-breaking order is undefined unless an additional sort field is specified.
Resolution
To ensure consistent ordering, use a nested sort that specifies a unique field as the final tie-breaker. The sort clause should follow this pattern:
sort: score desc, <unique_field> descExample: Sorting with a consistent tie-breaker
sort: score desc, id descscore desc– Primary sort criteria by relevance score.id desc– Final tie-breaker;idis recommended as it is unique for all documents.
Selecting the tie-breaker field
Use a field that contains unique values for all documents in the collection.
The field can be numeric, string, or text — as long as it is unique.
Common choices:
Primary key (
id)Unique product code
URL (for web page collections)
Phone number or other unique identifier
If the field is not unique, ties may still occur and result ordering may remain inconsistent.