Class AbstractSolrSearchProvider
java.lang.Object
de.hybris.platform.solrfacetsearch.solr.impl.AbstractSolrSearchProvider
- All Implemented Interfaces:
SolrSearchProvider
- Direct Known Subclasses:
SolrCloudSearchProvider,SolrStandaloneSearchProvider
Abstract implementation of
SolrSearchProvider.-
Nested Class Summary
Nested classes/interfaces inherited from interface de.hybris.platform.solrfacetsearch.solr.SolrSearchProvider
SolrSearchProvider.CommitType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final Stringprotected static final Stringprotected static final intprotected static final intprotected static final intprotected static final intprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidcloseHttpClient(org.apache.http.client.HttpClient httpClient) collectLanguages(FacetSearchConfig configuration) voidcommit(Index index, SolrSearchProvider.CommitType commitType) Performs a commit on the given index.protected org.apache.http.client.HttpClientcreateHttpClient(SolrClientConfig solrClientConfig) voiddeleteAllDocuments(Index index) Deletes all documents from an index.voiddeleteDocumentsByPk(Index index, Collection<PK> pks) Deletes documents matching the provided list of pksvoiddeleteOldDocuments(Index index, long indexOperationId) Deletes old documents from an index.protected Stringprotected StringencodePath(String string) protected voidexecuteDelete(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String path) protected org.apache.solr.common.util.NamedList<Object>executeGet(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String path) protected voidexecutePost(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String path, Object payload) expandSynonyms(String value) protected voidexportConfig(Index index, org.apache.solr.client.solrj.SolrClient solrClient) protected voidexportStopWords(Index index, org.apache.solr.client.solrj.SolrClient solrClient, Map<String, ManagedResource> managedResources, List<String> languages) protected voidexportSynonyms(Index index, org.apache.solr.client.solrj.SolrClient solrClient, Map<String, ManagedResource> managedResources, List<String> languages) protected intgetIntegerValue(Integer bigInt, int defaultValue) protected Map<String,ManagedResource> loadManagedResourcesFromServer(Index index, org.apache.solr.client.solrj.SolrClient solrClient) loadStopWordsFromConfiguration(FacetSearchConfig facetSearchConfig, Collection<String> languages) loadStopWordsFromServer(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String managedResourcePath) loadSynonymsFromConfiguration(FacetSearchConfig facetSearchConfig, Collection<String> languages) loadSynonymsFromServer(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String managedResourcePath) voidOptimizes a given index.protected StringresolveConfigSet(Index index) resolveIndex(FacetSearchConfig facetSearchConfig, IndexedType indexedType, String qualifier) Resolves an index.voidsetConfigurationService(ConfigurationService configurationService) voidsetIndexNameResolver(IndexNameResolver indexNameResolver) voidsetSolrClientPool(SolrClientPool solrClientPool) voidsetSolrFacetSearchConfigDao(SolrFacetSearchConfigDao solrFacetSearchConfigDao) protected voidupdateStopWordsOnServer(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String managedResourcePath, Set<String> stopWords, Set<String> serverStopWords) protected voidupdateSynonymsOnServer(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String managedResourcePath, Map<String, Set<String>> synonyms, Map<String, Set<String>> serverSynonyms) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.solrfacetsearch.solr.SolrSearchProvider
createIndex, deleteIndex, exportConfig, getClient, getClientForIndexing
-
Field Details
-
INDEX_PARAM
- See Also:
-
DEFAULT_ALIVE_CHECK_INTERVAL
protected static final int DEFAULT_ALIVE_CHECK_INTERVAL- See Also:
-
DEFAULT_MAX_CONNECTIONS
protected static final int DEFAULT_MAX_CONNECTIONS- See Also:
-
DEFAULT_MAX_CONNECTIONS_PER_HOST
protected static final int DEFAULT_MAX_CONNECTIONS_PER_HOST- See Also:
-
DEFAULT_SOCKET_TIMEOUT
protected static final int DEFAULT_SOCKET_TIMEOUT- See Also:
-
DEFAULT_CONNECTION_TIMEOUT
protected static final int DEFAULT_CONNECTION_TIMEOUT- See Also:
-
DEFAULT_CONFIGSET_PROPERTY
- See Also:
-
DEFAULT_CONFIGSET_VALUE
- See Also:
-
SYNONYM_SPLIT_CHAR
- See Also:
-
PERCENT_CHAR
- See Also:
-
MANAGED_INIT_ARGS_FIELD
- See Also:
-
MANAGED_IGNORE_CASE_FIELD
- See Also:
-
MANAGED_LIST_FIELD
- See Also:
-
MANAGED_MAP_FIELD
- See Also:
-
MANAGED_RESOURCES_PATH
- See Also:
-
MANAGED_RESOURCES_ROOT_FIELD
- See Also:
-
MANAGED_SYNONYMS_IGNORE_CASE_KEY
- See Also:
-
MANAGED_SYNONYMS_TYPE
- See Also:
-
MANAGED_SYNONYMS_PATH
- See Also:
-
MANAGED_SYNONYMS_ROOT_FIELD
- See Also:
-
MANAGED_STOP_WORDS_IGNORE_CASE_KEY
- See Also:
-
MANAGED_STOP_WORDS_TYPE
- See Also:
-
MANAGED_STOP_WORDS_PATH
- See Also:
-
MANAGED_STOP_WORDS_ROOT_FIELD
- See Also:
-
JSON_CONTENT_TYPE
- See Also:
-
UTF8_ENCODING
- See Also:
-
SOLR_QUERY_SELECT_ALL
- See Also:
-
-
Constructor Details
-
AbstractSolrSearchProvider
public AbstractSolrSearchProvider()
-
-
Method Details
-
resolveIndex
public Index resolveIndex(FacetSearchConfig facetSearchConfig, IndexedType indexedType, String qualifier) Description copied from interface:SolrSearchProviderResolves an index. Resolving an index only creates a search provider specific instance ofIndex.- Specified by:
resolveIndexin interfaceSolrSearchProvider- Parameters:
facetSearchConfig- - the facet search configurationindexedType- - the indexed typequalifier- - the qualifier- Returns:
- the index
-
deleteAllDocuments
Description copied from interface:SolrSearchProviderDeletes all documents from an index.- Specified by:
deleteAllDocumentsin interfaceSolrSearchProvider- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-
deleteOldDocuments
Description copied from interface:SolrSearchProviderDeletes old documents from an index. Old documents are documents that were not created/updated since a given index operation.- Specified by:
deleteOldDocumentsin interfaceSolrSearchProvider- Parameters:
index- - the indexindexOperationId- - the index operation id- Throws:
SolrServiceException- if an error occurs
-
deleteDocumentsByPk
Description copied from interface:SolrSearchProviderDeletes documents matching the provided list of pks- Specified by:
deleteDocumentsByPkin interfaceSolrSearchProvider- Parameters:
index- - the indexpks- - the pks list- Throws:
SolrServiceException- if an error occurs
-
commit
public void commit(Index index, SolrSearchProvider.CommitType commitType) throws SolrServiceException Description copied from interface:SolrSearchProviderPerforms a commit on the given index. An hard commit makes sure that indexed documents are persisted and visible, a soft commit makes sure indexed documents are visible.- Specified by:
commitin interfaceSolrSearchProvider- Parameters:
index- - the indexcommitType- - the commit type- Throws:
SolrServiceException- if an error occurs
-
optimize
Description copied from interface:SolrSearchProviderOptimizes a given index. It does not wait for the operation to complete.- Specified by:
optimizein interfaceSolrSearchProvider- Parameters:
index- - the index- Throws:
SolrServiceException- if an error occurs
-
resolveConfigSet
-
getIntegerValue
-
createHttpClient
-
closeHttpClient
protected void closeHttpClient(org.apache.http.client.HttpClient httpClient) -
exportConfig
protected void exportConfig(Index index, org.apache.solr.client.solrj.SolrClient solrClient) throws SolrServiceException, org.apache.solr.client.solrj.SolrServerException, IOException - Throws:
SolrServiceExceptionorg.apache.solr.client.solrj.SolrServerExceptionIOException
-
loadManagedResourcesFromServer
protected Map<String,ManagedResource> loadManagedResourcesFromServer(Index index, org.apache.solr.client.solrj.SolrClient solrClient) throws org.apache.solr.client.solrj.SolrServerException, IOException - Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
collectLanguages
-
exportSynonyms
protected void exportSynonyms(Index index, org.apache.solr.client.solrj.SolrClient solrClient, Map<String, ManagedResource> managedResources, List<String> languages) throws IOException, SolrServiceException- Throws:
IOExceptionSolrServiceException
-
loadSynonymsFromConfiguration
protected Map<String,Map<String, loadSynonymsFromConfigurationSet<String>>> (FacetSearchConfig facetSearchConfig, Collection<String> languages) -
buildSynonyms
-
expandSynonyms
-
loadSynonymsFromServer
protected Map<String,Set<String>> loadSynonymsFromServer(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String managedResourcePath) throws org.apache.solr.client.solrj.SolrServerException, IOException - Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
updateSynonymsOnServer
protected void updateSynonymsOnServer(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String managedResourcePath, Map<String, Set<String>> synonyms, Map<String, throws SolrServiceException, org.apache.solr.client.solrj.SolrServerException, IOExceptionSet<String>> serverSynonyms) - Throws:
SolrServiceExceptionorg.apache.solr.client.solrj.SolrServerExceptionIOException
-
exportStopWords
protected void exportStopWords(Index index, org.apache.solr.client.solrj.SolrClient solrClient, Map<String, ManagedResource> managedResources, List<String> languages) throws IOException, SolrServiceException- Throws:
IOExceptionSolrServiceException
-
loadStopWordsFromConfiguration
protected Map<String,Set<String>> loadStopWordsFromConfiguration(FacetSearchConfig facetSearchConfig, Collection<String> languages) -
loadStopWordsFromServer
protected Set<String> loadStopWordsFromServer(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String managedResourcePath) throws org.apache.solr.client.solrj.SolrServerException, IOException - Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
updateStopWordsOnServer
protected void updateStopWordsOnServer(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String managedResourcePath, Set<String> stopWords, Set<String> serverStopWords) throws SolrServiceException, org.apache.solr.client.solrj.SolrServerException, IOException - Throws:
SolrServiceExceptionorg.apache.solr.client.solrj.SolrServerExceptionIOException
-
encodePath
- Throws:
SolrServiceException
-
encode
- Throws:
SolrServiceException
-
executeGet
protected org.apache.solr.common.util.NamedList<Object> executeGet(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String path) throws org.apache.solr.client.solrj.SolrServerException, IOException - Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
executePost
protected void executePost(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String path, Object payload) throws org.apache.solr.client.solrj.SolrServerException, IOException - Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
executeDelete
protected void executeDelete(org.apache.solr.client.solrj.SolrClient solrClient, String indexName, String path) throws org.apache.solr.client.solrj.SolrServerException, IOException - Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
getSolrFacetSearchConfigDao
-
setSolrFacetSearchConfigDao
-
getIndexNameResolver
-
setIndexNameResolver
-
getConfigurationService
-
setConfigurationService
-
getSolrClientPool
-
setSolrClientPool
-