SOLR-9800: Factor out FacetComponent.newSimpleFacets method. (Jonny Marks via Christine Poerschke)

This commit is contained in:
Christine Poerschke 2017-02-06 15:49:38 +01:00
parent 9dcfcb6e6f
commit ef03480743
2 changed files with 9 additions and 1 deletions

View File

@ -172,6 +172,8 @@ Other Changes
SolrSuggester.build() now throws SolrCoreState.CoreIsClosedException when interrupted
by a core reload/shutdown. (Steve Rowe)
* SOLR-9800: Factor out FacetComponent.newSimpleFacets method. (Jonny Marks via Christine Poerschke)
================== 6.4.1 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

View File

@ -50,6 +50,7 @@ import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.FieldType;
import org.apache.solr.schema.PointField;
import org.apache.solr.search.QueryParsing;
import org.apache.solr.search.DocSet;
import org.apache.solr.search.SyntaxError;
import org.apache.solr.search.facet.FacetDebugInfo;
import org.apache.solr.util.RTimer;
@ -103,6 +104,11 @@ public class FacetComponent extends SearchComponent {
}
}
/* Custom facet components can return a custom SimpleFacets object */
protected SimpleFacets newSimpleFacets(SolrQueryRequest req, DocSet docSet, SolrParams params, ResponseBuilder rb) {
return new SimpleFacets(req, docSet, params, rb);
}
/**
* Encapsulates facet ranges and facet queries such that their parameters
* are parsed and cached for efficient re-use.
@ -253,7 +259,7 @@ public class FacetComponent extends SearchComponent {
if (rb.doFacets) {
SolrParams params = rb.req.getParams();
SimpleFacets f = new SimpleFacets(rb.req, rb.getResults().docSet, params, rb);
SimpleFacets f = newSimpleFacets(rb.req, rb.getResults().docSet, params, rb);
RTimer timer = null;
FacetDebugInfo fdebug = null;