Skip to content

Apache Lucene open-source search software

SOLR-591 -- Changed Solrj default value for facet.sort to true

Shalin Shekhar Mangar25a88db88181
diff --git a/CHANGES.txt b/CHANGES.txt
index f88e233f230..56e7c61e53f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -568,6 +568,8 @@ Other Changes
Lucene-Java (hossman)
17. SOLR-645: Refactored SimpleFacetsTest (Lars Kotthoff via hossman)
+
+18. SOLR-591: Changed Solrj default value for facet.sort to true (Lars Kotthoff via Shalin)
Build
1. SOLR-411. Changed the names of the Solr JARs to use the defacto standard JAR names based on
diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/SolrQuery.java b/client/java/solrj/src/org/apache/solr/client/solrj/SolrQuery.java
index 8779bb640ed..567955fdac7 100644
--- a/client/java/solrj/src/org/apache/solr/client/solrj/SolrQuery.java
+++ b/client/java/solrj/src/org/apache/solr/client/solrj/SolrQuery.java
@@ -194,7 +194,7 @@ public class SolrQuery extends ModifiableSolrParams
* @return facet sort or default of true
*/
public boolean getFacetSort() {
- return this.getBool(FacetParams.FACET_SORT, false);
+ return this.getBool(FacetParams.FACET_SORT, true);
}
/** set facet sort
diff --git a/client/java/solrj/test/org/apache/solr/client/solrj/SolrQueryTest.java b/client/java/solrj/test/org/apache/solr/client/solrj/SolrQueryTest.java
index 6e7df8f8bfc..006e0ea80b6 100644
--- a/client/java/solrj/test/org/apache/solr/client/solrj/SolrQueryTest.java
+++ b/client/java/solrj/test/org/apache/solr/client/solrj/SolrQueryTest.java
@@ -89,4 +89,11 @@ public class SolrQueryTest extends TestCase {
System.out.println(q);
}
+
+ public void testFacetSort() {
+ SolrQuery q = new SolrQuery("dog");
+ assertTrue("expected default value to be true", q.getFacetSort());
+ q.setFacetSort(false);
+ assertFalse("expected set value to be false", q.getFacetSort());
+ }
}