Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-6057: improve Sort(SortField) docs

Michael McCandless18efb159ef05
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index a7d22dc8aab..2a2a5a83ca7 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -258,6 +258,8 @@ Documentation
* LUCENE-5392: Add/improve analysis package documentation to reflect
analysis API changes. (Benson Margulies via Robert Muir - pull request #17)
+* LUCENE-6057: Improve Sort(SortField) docs (Martin Braun via Mike McCandless)
+
Tests
* LUCENE-5957: Add option for tests to not randomize codec
diff --git a/lucene/core/src/java/org/apache/lucene/search/Sort.java b/lucene/core/src/java/org/apache/lucene/search/Sort.java
index 57630635d20..eee5a6e15a3 100644
--- a/lucene/core/src/java/org/apache/lucene/search/Sort.java
+++ b/lucene/core/src/java/org/apache/lucene/search/Sort.java
@@ -127,7 +127,11 @@ public class Sort {
setSort(field);
}
- /** Sorts in succession by the criteria in each SortField. */
+ /** Sets the sort to the given criteria in succession: the
+ * first SortField is checked first, but if it produces a
+ * tie, then the second SortField is used to break the tie,
+ * etc. Finally, if there is still a tie after all SortFields
+ * are checked, the internal Lucene docid is used to break it. */
public Sort(SortField... fields) {
setSort(fields);
}
@@ -137,7 +141,11 @@ public class Sort {
this.fields = new SortField[] { field };
}
- /** Sets the sort to the given criteria in succession. */
+ /** Sets the sort to the given criteria in succession: the
+ * first SortField is checked first, but if it produces a
+ * tie, then the second SortField is used to break the tie,
+ * etc. Finally, if there is still a tie after all SortFields
+ * are checked, the internal Lucene docid is used to break it. */
public void setSort(SortField... fields) {
this.fields = fields;
}