From 9909374e0447834d98b8aa7be23d3221582f4e0f Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Sat, 15 Jul 2006 19:29:43 +0000 Subject: [PATCH] fix reverse sorting when sortMissingFirst=true git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@422280 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ src/java/org/apache/solr/search/Sorting.java | 2 +- src/test/test-files/solr/conf/schema.xml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 6b918a37c30..6a64eaa7eb2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -51,6 +51,8 @@ Bug Fixes 3. Added empty extractTerms() to FunctionQuery to enable use in a MultiSearcher (Yonik) 4. WordDelimiterFilter sometimes lost token positionIncrement information + 5. Fix reverse sorting for fields were sortMissingFirst=true + (Rob Staveley, yonik) Other Changes 1. Upgrade to Lucene 2.0 nightly build 2006-06-22, lucene SVN revision 416224, diff --git a/src/java/org/apache/solr/search/Sorting.java b/src/java/org/apache/solr/search/Sorting.java index b4252f568f2..cbacf7846ed 100644 --- a/src/java/org/apache/solr/search/Sorting.java +++ b/src/java/org/apache/solr/search/Sorting.java @@ -44,7 +44,7 @@ public class Sorting { if (!reverse) return new SortField(fieldName, nullStringLastComparatorSource); else return new SortField(fieldName, SortField.STRING, true); } else if (nullFirst) { - if (reverse) return new SortField(fieldName, nullStringLastComparatorSource); + if (reverse) return new SortField(fieldName, nullStringLastComparatorSource, true); else return new SortField(fieldName, SortField.STRING, false); } else { return new SortField(fieldName, SortField.STRING, reverse); diff --git a/src/test/test-files/solr/conf/schema.xml b/src/test/test-files/solr/conf/schema.xml index d6ad901e738..5860dd1c1a6 100644 --- a/src/test/test-files/solr/conf/schema.xml +++ b/src/test/test-files/solr/conf/schema.xml @@ -311,6 +311,7 @@ +