Class CSSearchSnSearchProvider
- java.lang.Object
-
- de.hybris.platform.searchservices.spi.service.impl.AbstractSnSearchProvider<CSSearchSnSearchProviderConfiguration>
-
- de.hybris.platform.searchprovidercssearchservices.spi.service.impl.CSSearchSnSearchProvider
-
- All Implemented Interfaces:
SnSearchProvider<CSSearchSnSearchProviderConfiguration>,org.springframework.beans.factory.InitializingBean
public class CSSearchSnSearchProvider extends AbstractSnSearchProvider<CSSearchSnSearchProviderConfiguration> implements org.springframework.beans.factory.InitializingBean
Implementation ofSnSearchProviderfor the search core service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classCSSearchSnSearchProvider.ListCustomMapperprotected static classCSSearchSnSearchProvider.MapCustomMapper
-
Constructor Summary
Constructors Constructor Description CSSearchSnSearchProvider()
-
Method Summary
-
Methods inherited from class de.hybris.platform.searchservices.spi.service.impl.AbstractSnSearchProvider
getSearchProviderConfiguration
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
registerMappings
protected void registerMappings(ma.glasnost.orika.MapperFactory mapperFactory)
-
getMapperFacade
protected ma.glasnost.orika.MapperFacade getMapperFacade()
-
exportConfiguration
public void exportConfiguration(SnContext context) throws SnException
Description copied from interface:SnSearchProviderExports the configuration to the search provider.- Specified by:
exportConfigurationin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the context- Throws:
SnException- if an error occurs
-
exportSynonymDictionaries
protected void exportSynonymDictionaries(CSSearchClient client, SnContext context) throws SnException
- Throws:
SnException
-
convertSynonymDictionary
protected SynonymDictionaryDTO convertSynonymDictionary(SnSynonymDictionary source)
-
convertSynonymEntry
protected SynonymEntryDTO convertSynonymEntry(SnSynonymEntry source)
-
exportIndexConfiguration
protected void exportIndexConfiguration(CSSearchClient client, SnContext context) throws SnException
- Throws:
SnException
-
convertIndexConfiguration
protected IndexConfigurationDTO convertIndexConfiguration(SnIndexConfiguration source)
-
convertLanguage
protected LanguageDTO convertLanguage(SnLanguage source)
-
convertCurrencyQualifierType
protected QualifierTypeDTO convertCurrencyQualifierType(SnIndexConfiguration configuration)
-
convertCurrencyQualifier
protected QualifierDTO convertCurrencyQualifier(SnCurrency source)
-
exportIndexType
protected void exportIndexType(CSSearchClient client, SnContext context) throws SnException
- Throws:
SnException
-
convertIndexType
protected IndexTypeDTO convertIndexType(SnIndexType source)
-
convertFieldType
protected FieldTypeDTO convertFieldType(SnFieldType source)
-
createIndex
public void createIndex(SnContext context, java.lang.String indexId) throws SnException
Description copied from interface:SnSearchProviderCreates an index (if it does not exist).- Specified by:
createIndexin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the contextindexId- - the index id- Throws:
SnException- if an error occurs
-
deleteIndex
public void deleteIndex(SnContext context, java.lang.String indexId) throws SnException
Description copied from interface:SnSearchProviderDeletes an index (if it exists).- Specified by:
deleteIndexin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the contextindexId- - the index id- Throws:
SnException- if an error occurs
-
createIndexerOperation
public SnIndexerOperation createIndexerOperation(SnContext context, SnIndexerOperationType indexerOperationType, int totalItems) throws SnException
Description copied from interface:SnSearchProviderCreates a new indexer operation.- Specified by:
createIndexerOperationin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the context- Throws:
SnException- if an error occurs
-
updateIndexerOperationStatus
public SnIndexerOperation updateIndexerOperationStatus(SnContext context, java.lang.String indexerOperationId, SnIndexerOperationStatus status, java.lang.String errorMessage) throws SnException
Description copied from interface:SnSearchProviderUpdates the status of an indexer operation.- Specified by:
updateIndexerOperationStatusin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the contextstatus- - the statuserrorMessage- - the errorMessage- Throws:
SnException- if an error occurs
-
convertIndexerOperationType
protected IndexerOperationTypeDTO convertIndexerOperationType(SnIndexerOperationType source)
-
convertIndexerOperationType
protected SnIndexerOperationType convertIndexerOperationType(IndexerOperationTypeDTO source)
-
convertIndexerOperationStatus
protected IndexerOperationStatusDTO convertIndexerOperationStatus(SnIndexerOperationStatus source)
-
convertIndexerOperationStatus
protected SnIndexerOperationStatus convertIndexerOperationStatus(IndexerOperationStatusDTO source)
-
convertIndexerOperation
protected SnIndexerOperation convertIndexerOperation(IndexerOperationDTO source)
-
executeDocumentBatch
public SnDocumentBatchResponse executeDocumentBatch(SnContext context, java.lang.String indexId, SnDocumentBatchRequest documentBatchRequest, java.lang.String indexerOperationId) throws SnException
Description copied from interface:SnSearchProviderExecutes a document batch.- Specified by:
executeDocumentBatchin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the contextindexId- - the index iddocumentBatchRequest- - the document batch requestindexerOperationId- - the indexer operation id- Returns:
- the document batch response
- Throws:
SnException- if an error occurs
-
convertDocument
protected DocumentDTO convertDocument(SnDocument source)
-
convertDocumenBatchRequest
protected DocumentBatchRequestDTO convertDocumenBatchRequest(SnDocumentBatchRequest source, java.lang.String indexerOperationId)
-
convertDocumenBatchOperationRequest
protected DocumentBatchOperationRequestDTO convertDocumenBatchOperationRequest(SnDocumentBatchOperationRequest source)
-
convertDocumenOperationType
protected java.lang.String convertDocumenOperationType(SnDocumentOperationType source)
-
convertDocumenBatchResponse
protected SnDocumentBatchResponse convertDocumenBatchResponse(DocumentBatchResponseDTO source)
-
convertDocumenBatchOperationResponse
protected SnDocumentBatchOperationResponse convertDocumenBatchOperationResponse(DocumentBatchOperationResponseDTO source)
-
convertDocumenOperationStatus
protected SnDocumentOperationStatus convertDocumenOperationStatus(java.lang.Integer statusCode)
-
commit
public void commit(SnContext context, java.lang.String indexId) throws SnException
Description copied from interface:SnSearchProviderMakes sure that documents are stored on the index storage and are visible for queries.- Specified by:
commitin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the contextindexId- - the index id- Throws:
SnException- if an error occurs
-
search
public SnSearchResult search(SnContext context, java.lang.String indexId, SnSearchQuery searchQuery) throws SnException
Description copied from interface:SnSearchProviderExecutes a search query on a specific index.- Specified by:
searchin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the contextindexId- - the index idsearchQuery- - the search query- Returns:
- the search result
- Throws:
SnException- if an error occurs
-
convertSearchQuery
protected SearchQueryDTO convertSearchQuery(SnSearchQuery source)
-
convertSearchResult
protected SnSearchResult convertSearchResult(SnSearchQuery searchQuery, SearchResultDTO source)
-
suggest
public SnSuggestResult suggest(SnContext context, java.lang.String indexId, SnSuggestQuery suggestQuery) throws SnException
Description copied from interface:SnSearchProviderExecutes a suggest query on a specific index.- Specified by:
suggestin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the contextindexId- - the index idsuggestQuery- - the suggest query- Returns:
- the suggest result
- Throws:
SnException- if an error occurs
-
convertSuggestQuery
protected SuggestQueryDTO convertSuggestQuery(SnSuggestQuery source)
-
convertSuggestResult
protected SnSuggestResult convertSuggestResult(SuggestResultDTO source)
-
createLanguageHeader
protected java.lang.String createLanguageHeader(SnContext context)
-
createQualifierHeader
protected java.lang.String createQualifierHeader(SnContext context)
-
filterQualifierHeader
protected boolean filterQualifierHeader(java.util.Map.Entry<java.lang.String,java.util.List<SnQualifier>> entry)
-
buildQualifierHeader
protected java.lang.String buildQualifierHeader(java.util.Map.Entry<java.lang.String,java.util.List<SnQualifier>> entry)
-
createClient
protected CSSearchClient createClient(SnContext context) throws SnException
- Throws:
SnException
-
getDestinationService
public DestinationService<ConsumedDestinationModel> getDestinationService()
-
setDestinationService
public void setDestinationService(DestinationService<ConsumedDestinationModel> destinationService)
-
getApiRegistryClientService
public ApiRegistryClientService getApiRegistryClientService()
-
setApiRegistryClientService
public void setApiRegistryClientService(ApiRegistryClientService apiRegistryClientService)
-
getCommonI18NService
public CommonI18NService getCommonI18NService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
getClientFactory
public ClientFactory getClientFactory()
-
setClientFactory
public void setClientFactory(ClientFactory clientFactory)
-
getSnSynonymDictionaryService
public SnSynonymDictionaryService getSnSynonymDictionaryService()
-
setSnSynonymDictionaryService
public void setSnSynonymDictionaryService(SnSynonymDictionaryService snSynonymDictionaryService)
-
-