Class SolrCloudSearchProvider
- java.lang.Object
-
- de.hybris.platform.solrfacetsearch.solr.impl.AbstractSolrSearchProvider
-
- de.hybris.platform.solrfacetsearch.solr.impl.SolrCloudSearchProvider
-
- All Implemented Interfaces:
SolrSearchProvider
public class SolrCloudSearchProvider extends AbstractSolrSearchProvider
SolrSearchProviderimplementation for Solr Cloud.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classSolrCloudSearchProvider.CloudResponse<T extends org.apache.solr.client.solrj.SolrResponse>-
Nested classes/interfaces inherited from interface de.hybris.platform.solrfacetsearch.solr.SolrSearchProvider
SolrSearchProvider.CommitType
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringAUTO_ADD_REPLICAS_PARAMprotected static intCREATE_INDEX_MAX_RETRIESprotected static intDEFAULT_NUMBER_OF_SHARDSprotected static intDEFAULT_REPLICATION_FACTORprotected static java.lang.StringNUMBER_OF_SHARDS_PARAMprotected static java.lang.StringREPLICATION_FACTOR_PARAM-
Fields inherited from class de.hybris.platform.solrfacetsearch.solr.impl.AbstractSolrSearchProvider
DEFAULT_ALIVE_CHECK_INTERVAL, DEFAULT_CONFIGSET_PROPERTY, DEFAULT_CONFIGSET_VALUE, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_MAX_CONNECTIONS, DEFAULT_MAX_CONNECTIONS_PER_HOST, DEFAULT_SOCKET_TIMEOUT, INDEX_PARAM, JSON_CONTENT_TYPE, MANAGED_IGNORE_CASE_FIELD, MANAGED_INIT_ARGS_FIELD, MANAGED_LIST_FIELD, MANAGED_MAP_FIELD, MANAGED_RESOURCES_PATH, MANAGED_RESOURCES_ROOT_FIELD, MANAGED_STOP_WORDS_IGNORE_CASE_KEY, MANAGED_STOP_WORDS_PATH, MANAGED_STOP_WORDS_ROOT_FIELD, MANAGED_STOP_WORDS_TYPE, MANAGED_SYNONYMS_IGNORE_CASE_KEY, MANAGED_SYNONYMS_PATH, MANAGED_SYNONYMS_ROOT_FIELD, MANAGED_SYNONYMS_TYPE, SOLR_QUERY_SELECT_ALL, SYNONYM_SPLIT_CHAR, UTF8_ENCODING
-
-
Constructor Summary
Constructors Constructor Description SolrCloudSearchProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseClient(org.apache.solr.client.solrj.SolrClient solrClient)protected <T extends org.apache.solr.client.solrj.response.SolrResponseBase>
SolrCloudSearchProvider.CloudResponse<T>cloudRequest(org.apache.solr.client.solrj.SolrRequest<T> request, CachedSolrClient solrClient, java.lang.String collection)protected org.apache.solr.client.solrj.impl.CloudSolrClientcreateClient(SolrConfig solrConfig, SolrClientConfig solrClientConfig)voidcreateIndex(Index index)Creates an index (if it does not exist).voiddeleteIndex(Index index)Deletes an index (if it exists).protected SolrCloudSearchProvider.CloudResponse<org.apache.solr.client.solrj.response.CollectionAdminResponse>doCreateIndex(Index index, CachedSolrClient solrClient)protected SolrCloudSearchProvider.CloudResponse<org.apache.solr.client.solrj.response.CollectionAdminResponse>doDeleteIndex(Index index, CachedSolrClient solrClient)protected SolrCloudSearchProvider.CloudResponse<org.apache.solr.client.solrj.response.CollectionAdminResponse>doListIndexes(CachedSolrClient solrClient)protected SolrCloudSearchProvider.CloudResponse<org.apache.solr.client.solrj.response.CollectionAdminResponse>doReloadIndex(Index index, CachedSolrClient solrClient)voidexportConfig(Index index)Exports the configuration to a specific index.CachedSolrClientgetClient(Index index)ReturnsSolrClientfor specificIndex, that can be used for searches.CachedSolrClientgetClientForIndexing(Index index)ReturnsSolrClientfor specificIndex, that can be used for indexing.protected booleanindexExists(Index index, org.apache.solr.client.solrj.response.CollectionAdminResponse response)protected java.lang.BooleanresolveAutoAddReplicas(Index index)protected java.lang.IntegerresolveNumShards(Index index)protected java.lang.IntegerresolveReplicationFactor(Index index)protected voidvalidateConfiguration(SolrConfig solrConfig)-
Methods inherited from class de.hybris.platform.solrfacetsearch.solr.impl.AbstractSolrSearchProvider
buildSynonyms, closeHttpClient, collectLanguages, commit, createHttpClient, deleteAllDocuments, deleteDocumentsByPk, deleteOldDocuments, encode, executeDelete, executeGet, executePost, expandSynonyms, exportConfig, exportStopWords, exportSynonyms, getConfigurationService, getIndexNameResolver, getIntegerValue, getSolrClientPool, getSolrFacetSearchConfigDao, loadManagedResourcesFromServer, loadStopWordsFromConfiguration, loadStopWordsFromServer, loadSynonymsFromConfiguration, loadSynonymsFromServer, optimize, resolveConfigSet, resolveIndex, setConfigurationService, setIndexNameResolver, setSolrClientPool, setSolrFacetSearchConfigDao, updateStopWordsOnServer, updateSynonymsOnServer
-
-
-
-
Field Detail
-
CREATE_INDEX_MAX_RETRIES
protected static final int CREATE_INDEX_MAX_RETRIES
- See Also:
- Constant Field Values
-
NUMBER_OF_SHARDS_PARAM
protected static final java.lang.String NUMBER_OF_SHARDS_PARAM
- See Also:
- Constant Field Values
-
DEFAULT_NUMBER_OF_SHARDS
protected static final int DEFAULT_NUMBER_OF_SHARDS
- See Also:
- Constant Field Values
-
REPLICATION_FACTOR_PARAM
protected static final java.lang.String REPLICATION_FACTOR_PARAM
- See Also:
- Constant Field Values
-
DEFAULT_REPLICATION_FACTOR
protected static final int DEFAULT_REPLICATION_FACTOR
- See Also:
- Constant Field Values
-
AUTO_ADD_REPLICAS_PARAM
protected static final java.lang.String AUTO_ADD_REPLICAS_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
getClient
public CachedSolrClient getClient(Index index) throws SolrServiceException
Description copied from interface:SolrSearchProviderReturnsSolrClientfor specificIndex, that can be used for searches.- Parameters:
index- - the index- Returns:
SolrClientinstance- Throws:
SolrServiceException- if an error occurs
-
getClientForIndexing
public CachedSolrClient getClientForIndexing(Index index) throws SolrServiceException
Description copied from interface:SolrSearchProviderReturnsSolrClientfor specificIndex, that can be used for indexing.- Parameters:
index- - the index- Returns:
SolrClientinstance- Throws:
SolrServiceException- if an error occurs
-
createClient
protected org.apache.solr.client.solrj.impl.CloudSolrClient createClient(SolrConfig solrConfig, SolrClientConfig solrClientConfig)
-
closeClient
protected void closeClient(org.apache.solr.client.solrj.SolrClient solrClient)
-
createIndex
public void createIndex(Index index) throws SolrServiceException
Description copied from interface:SolrSearchProviderCreates an index (if it does not exist).- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-
deleteIndex
public void deleteIndex(Index index) throws SolrServiceException
Description copied from interface:SolrSearchProviderDeletes an index (if it exists).- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-
exportConfig
public void exportConfig(Index index) throws SolrServiceException
Description copied from interface:SolrSearchProviderExports the configuration to a specific index.- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-
validateConfiguration
protected void validateConfiguration(SolrConfig solrConfig)
-
indexExists
protected boolean indexExists(Index index, org.apache.solr.client.solrj.response.CollectionAdminResponse response)
-
doListIndexes
protected SolrCloudSearchProvider.CloudResponse<org.apache.solr.client.solrj.response.CollectionAdminResponse> doListIndexes(CachedSolrClient solrClient)
-
doCreateIndex
protected SolrCloudSearchProvider.CloudResponse<org.apache.solr.client.solrj.response.CollectionAdminResponse> doCreateIndex(Index index, CachedSolrClient solrClient)
-
doDeleteIndex
protected SolrCloudSearchProvider.CloudResponse<org.apache.solr.client.solrj.response.CollectionAdminResponse> doDeleteIndex(Index index, CachedSolrClient solrClient)
-
doReloadIndex
protected SolrCloudSearchProvider.CloudResponse<org.apache.solr.client.solrj.response.CollectionAdminResponse> doReloadIndex(Index index, CachedSolrClient solrClient)
-
cloudRequest
protected <T extends org.apache.solr.client.solrj.response.SolrResponseBase> SolrCloudSearchProvider.CloudResponse<T> cloudRequest(org.apache.solr.client.solrj.SolrRequest<T> request, CachedSolrClient solrClient, java.lang.String collection)
-
resolveNumShards
protected java.lang.Integer resolveNumShards(Index index)
-
resolveReplicationFactor
protected java.lang.Integer resolveReplicationFactor(Index index)
-
resolveAutoAddReplicas
protected java.lang.Boolean resolveAutoAddReplicas(Index index)
-
-