You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ge...@apache.org on 2020/03/16 15:36:39 UTC

[lucene-solr] branch branch_8_5 updated: Document sort param tiebreak logic (#1349)

This is an automated email from the ASF dual-hosted git repository.

gerlowskija pushed a commit to branch branch_8_5
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8_5 by this push:
     new 1050e45  Document sort param tiebreak logic (#1349)
1050e45 is described below

commit 1050e459027c35d15d4d1ea91a6c14cf2052594f
Author: Jason Gerlowski <ge...@apache.org>
AuthorDate: Mon Mar 16 07:59:25 2020 -0400

    Document sort param tiebreak logic (#1349)
---
 solr/solr-ref-guide/src/common-query-parameters.adoc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/solr/solr-ref-guide/src/common-query-parameters.adoc b/solr/solr-ref-guide/src/common-query-parameters.adoc
index d2915f4..1cfd391 100644
--- a/solr/solr-ref-guide/src/common-query-parameters.adoc
+++ b/solr/solr-ref-guide/src/common-query-parameters.adoc
@@ -63,7 +63,10 @@ Regarding the sort parameter's arguments:
 * A sort ordering must include a field name (or `score` as a pseudo field), followed by whitespace (escaped as + or `%20` in URL strings), followed by a sort direction (`asc` or `desc`).
 
 * Multiple sort orderings can be separated by a comma, using this syntax: `sort=<field name>+<direction>,<field name>+<direction>],...`
-** When more than one sort criteria is provided, the second entry will only be used if the first entry results in a tie. If there is a third entry, it will only be used if the first AND second entries are tied. This pattern continues with further entries.
+** When more than one sort criteria is provided, the second entry will only be used if the first entry results in a tie. If there is a third entry, it will only be used if the first AND second entries are tied. And so on.
+** If documents tie in all of the explicit sort criteria, Solr uses each document's Lucene document ID as the final tie-breaker.
+This internal property is subject to change during segment merges and document updates, which can lead to unexpected result ordering changes.
+Users looking to avoid this behavior can add an additional sort criteria on a unique or rarely-shared field such as `id` to prevent ties from occurring (e.g. `price desc,id asc`).
 
 == start Parameter