You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ry...@apache.org on 2013/04/16 18:13:44 UTC
svn commit: r1468486 - in /lucene/dev/trunk: ./ solr/ solr/CHANGES.txt
solr/core/ solr/core/src/java/org/apache/solr/request/SimpleFacets.java
solr/core/src/test/org/apache/solr/request/TestFaceting.java
Author: ryan
Date: Tue Apr 16 16:13:44 2013
New Revision: 1468486
URL: http://svn.apache.org/r1468486
Log:
SOLR-4717: SimpleFacets uses localParams (merge from 4x)
Modified:
lucene/dev/trunk/ (props changed)
lucene/dev/trunk/solr/ (props changed)
lucene/dev/trunk/solr/CHANGES.txt (contents, props changed)
lucene/dev/trunk/solr/core/ (props changed)
lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestFaceting.java
Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1468486&r1=1468485&r2=1468486&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Tue Apr 16 16:13:44 2013
@@ -142,6 +142,8 @@ New Features
5.0) for basing the enumeration of cores. In the new way of doing things, a
core.propeties file will mark the instanceDir for that core, and instanceDir will
be obsolete as well
+
+* SOLR-4717: SimpleFacets now work with localParams (ryan)
Bug Fixes
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SimpleFacets.java?rev=1468486&r1=1468485&r2=1468486&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SimpleFacets.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SimpleFacets.java Tue Apr 16 16:13:44 2013
@@ -105,17 +105,18 @@ public class SimpleFacets {
/** The main set of documents all facet counts should be relative to */
protected DocSet docsOrig;
/** Configuration params behavior should be driven by */
- protected SolrParams params;
- protected SolrParams required;
+ protected final SolrParams orig;
+ protected final SolrParams required;
/** Searcher to use for all calculations */
- protected SolrIndexSearcher searcher;
- protected SolrQueryRequest req;
- protected ResponseBuilder rb;
+ protected final SolrIndexSearcher searcher;
+ protected final SolrQueryRequest req;
+ protected final ResponseBuilder rb;
protected SimpleOrderedMap<Object> facetResponse;
// per-facet values
protected SolrParams localParams; // localParams on this particular facet command
+ protected SolrParams params; // local+original
protected String facetValue; // the field to or query to facet on (minus local params)
protected DocSet docs; // the base docset for this particular facet
protected String key; // what name should the results be stored under
@@ -134,7 +135,7 @@ public class SimpleFacets {
this.req = req;
this.searcher = req.getSearcher();
this.docs = this.docsOrig = docs;
- this.params = params;
+ this.params = orig = params;
this.required = new RequiredSolrParams(params);
this.rb = rb;
}
@@ -147,7 +148,10 @@ public class SimpleFacets {
key = param;
threads = -1;
- if (localParams == null) return;
+ if (localParams == null) {
+ return;
+ }
+ params = SolrParams.wrapDefaults(localParams, orig);
// remove local params unless it's a query
if (type != FacetParams.FACET_QUERY) { // TODO Cut over to an Enum here
Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestFaceting.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestFaceting.java?rev=1468486&r1=1468485&r2=1468486&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestFaceting.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestFaceting.java Tue Apr 16 16:13:44 2013
@@ -27,6 +27,7 @@ import org.apache.lucene.index.Term;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.util.BytesRef;
import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.FacetParams;
import org.junit.After;
import org.junit.BeforeClass;