Class DefaultSolrSearchProvider
java.lang.Object
com.broadleafcommerce.search.provider.solr.AbstractBasicAuthAwareSolrProvider
com.broadleafcommerce.search.provider.solr.DefaultSolrSearchProvider
- All Implemented Interfaces:
com.broadleafcommerce.search.provider.SearchProvider<org.apache.solr.client.solrj.SolrQuery,
,org.apache.solr.client.solrj.response.QueryResponse> SolrProvider
public class DefaultSolrSearchProvider
extends AbstractBasicAuthAwareSolrProvider
implements com.broadleafcommerce.search.provider.SearchProvider<org.apache.solr.client.solrj.SolrQuery,org.apache.solr.client.solrj.response.QueryResponse>, SolrProvider
-
Field Summary
FieldsFields inherited from class com.broadleafcommerce.search.provider.solr.AbstractBasicAuthAwareSolrProvider
CLUSTER_STATUS_PATH
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSolrSearchProvider
(org.apache.solr.client.solrj.SolrClient solrClient, SolrCollectionResolver collectionResolver, org.apache.solr.client.solrj.SolrRequest.METHOD queryMethod, String userName, String password, com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected SolrCollectionResolver
getDefinedFields
(com.broadleafcommerce.search.api.type.IndexableType indexableType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) getDefinedFieldsInternal
(com.broadleafcommerce.search.api.type.IndexableType indexableType) Retrieve all fields defined in Solr for a particular indexable type.protected org.apache.solr.client.solrj.SolrRequest.METHOD
org.apache.solr.client.solrj.response.QueryResponse
search
(org.apache.solr.client.solrj.SolrQuery solrQuery, com.broadleafcommerce.search.api.type.IndexableType indexableType) Execute a Solr search for the provided requested query and type.org.apache.solr.client.solrj.response.QueryResponse
Execute a Solr search for the provided requested query and collection.Methods inherited from class com.broadleafcommerce.search.provider.solr.AbstractBasicAuthAwareSolrProvider
determineCollectionsFromAliases, getSolrBasicAuthPassword, getSolrBasicAuthUser, getSolrClient, reloadCollections, reloadCollectionsFromAliases, setBasicAuthCredentialsIfNecessary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.search.provider.solr.SolrProvider
getSolrClient
-
Field Details
-
SOLR_FIELD_CACHE
- See Also:
-
-
Constructor Details
-
DefaultSolrSearchProvider
public DefaultSolrSearchProvider(org.apache.solr.client.solrj.SolrClient solrClient, SolrCollectionResolver collectionResolver, org.apache.solr.client.solrj.SolrRequest.METHOD queryMethod, @Nullable String userName, @Nullable String password, @Nullable com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
-
-
Method Details
-
search
public org.apache.solr.client.solrj.response.QueryResponse search(org.apache.solr.client.solrj.SolrQuery solrQuery, com.broadleafcommerce.search.api.type.IndexableType indexableType) throws com.broadleafcommerce.search.api.SearchException Execute a Solr search for the provided requested query and type.- Specified by:
search
in interfacecom.broadleafcommerce.search.provider.SearchProvider<org.apache.solr.client.solrj.SolrQuery,
org.apache.solr.client.solrj.response.QueryResponse> - Parameters:
solrQuery
- The solr query to search byindexableType
- The indexable type to search for- Returns:
- QueryResponse from Solr
- Throws:
com.broadleafcommerce.search.api.SearchException
- if an error occurs searching in Solr
-
search
public org.apache.solr.client.solrj.response.QueryResponse search(org.apache.solr.client.solrj.SolrQuery solrQuery, String collection) throws com.broadleafcommerce.search.api.SearchException Execute a Solr search for the provided requested query and collection.- Specified by:
search
in interfacecom.broadleafcommerce.search.provider.SearchProvider<org.apache.solr.client.solrj.SolrQuery,
org.apache.solr.client.solrj.response.QueryResponse> - Parameters:
solrQuery
- The solr query to search bycollection
- The collection to search in- Returns:
- QueryResponse from Solr
- Throws:
com.broadleafcommerce.search.api.SearchException
- if an error occurs searching in Solr
-
getDefinedFields
-
getDefinedFieldsInternal
protected Set<String> getDefinedFieldsInternal(com.broadleafcommerce.search.api.type.IndexableType indexableType) Retrieve all fields defined in Solr for a particular indexable type. This is a workaround for a bug with the edismax query parser. This can be removed/re-evaluated if/when this bug is fixed: https://issues.apache.org/jira/browse/SOLR-6376- Parameters:
indexableType
- The indexable type- Returns:
- All fields, including dynamic fields, that have been defined in Solr.
-
getCollectionResolver
-
getQueryMethod
protected org.apache.solr.client.solrj.SolrRequest.METHOD getQueryMethod()
-