Class SolrLocalResponseBuilder
- java.lang.Object
-
- cool.solr.search.component.solr.util.SolrLocalResponseBuilder
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class SolrLocalResponseBuilder extends Object implements Closeable
Builder for a Solr response using a local Solr request.Always use inside try with resources!
-
-
Constructor Summary
Constructors Constructor Description SolrLocalResponseBuilder(org.apache.solr.handler.component.ResponseBuilder origin)Create local request builder from originating request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.solr.handler.component.ResponseBuilderbuild()Create a response builder.voidclose()static org.apache.solr.common.params.ModifiableSolrParamscomputeUnscoredSolrParams(org.apache.solr.common.params.SolrParams origParams)This takes the original incoming solr params and removes all scoring, boosting, grouping, collapsing and expanding params.static org.apache.solr.common.params.ModifiableSolrParamscomputeUnscoredSolrQueryParams(org.apache.solr.common.params.SolrParams original)This takes the original incoming solr params and creates new solr query params that contain query and filter query params only.static voidexecute(org.apache.solr.handler.component.ResponseBuilder response)Execute request by calling the search components directly.static org.apache.solr.handler.component.FacetComponentextractFacetComponent(List<org.apache.solr.handler.component.SearchComponent> components)Returns the facetComponent in components and null if no FacetComponent is presentstatic org.apache.solr.handler.component.QueryComponentextractQueryComponent(List<org.apache.solr.handler.component.SearchComponent> components)Returns the queryComponent in components and null if no QueryComponent is presentSolrLocalResponseBuilderuseFacetComponent()Use facet component too.SolrLocalResponseBuilderuseParams(org.apache.solr.common.params.SolrParams params)Use the given parameters for the request.SolrLocalResponseBuilderuseUnscoredSolrParams()This takes the original incoming solr params and removes all scoring, boosting, grouping, collapsing and expanding params.
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
useUnscoredSolrParams
public SolrLocalResponseBuilder useUnscoredSolrParams()
This takes the original incoming solr params and removes all scoring, boosting, grouping, collapsing and expanding params. It furthermore disables all spellchecking and query reductions.- Returns:
- this for method chaining.
-
useParams
public SolrLocalResponseBuilder useParams(org.apache.solr.common.params.SolrParams params)
Use the given parameters for the request.- Returns:
- this for method chaining.
-
useFacetComponent
public SolrLocalResponseBuilder useFacetComponent()
Use facet component too.- Returns:
- this for method chaining.
-
build
public org.apache.solr.handler.component.ResponseBuilder build()
Create a response builder.
-
execute
public static void execute(org.apache.solr.handler.component.ResponseBuilder response) throws IOExceptionExecute request by calling the search components directly.- Throws:
IOException
-
computeUnscoredSolrQueryParams
public static org.apache.solr.common.params.ModifiableSolrParams computeUnscoredSolrQueryParams(org.apache.solr.common.params.SolrParams original)
This takes the original incoming solr params and creates new solr query params that contain query and filter query params only. Sort params are replaced in order to reflect unscored document retrieval.Use these params on a subset of search components like the query and facet component only. With this shorter query params all clutter is removed from the query.
-
computeUnscoredSolrParams
public static org.apache.solr.common.params.ModifiableSolrParams computeUnscoredSolrParams(org.apache.solr.common.params.SolrParams origParams)
This takes the original incoming solr params and removes all scoring, boosting, grouping, collapsing and expanding params. It furthermore disables all spellchecking and query reductions.
-
extractQueryComponent
public static org.apache.solr.handler.component.QueryComponent extractQueryComponent(List<org.apache.solr.handler.component.SearchComponent> components)
Returns the queryComponent in components and null if no QueryComponent is present
-
extractFacetComponent
public static org.apache.solr.handler.component.FacetComponent extractFacetComponent(List<org.apache.solr.handler.component.SearchComponent> components)
Returns the facetComponent in components and null if no FacetComponent is present
-
-