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 of
SnSearchProvider for the search core service.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classprotected static classprotected static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildLocalizedName(CSSearchSnSearchProvider.ConverterContext converterContext, Map<Locale, String> source) protected StringbuildQualifierHeader(Map.Entry<String, List<SnQualifier>> entry) protected StringbuildRequestExceptionMessage(String message, com.hybris.charon.exp.HttpException exception) voidMakes sure that documents are stored on the index storage and are visible for queries.protected QualifierDTOconvertCurrencyQualifier(CSSearchSnSearchProvider.ConverterContext converterContext, SnCurrency source) protected QualifierTypeDTOconvertCurrencyQualifierType(CSSearchSnSearchProvider.ConverterContext converterContext, SnIndexConfiguration indexConfiguration) protected DocumentBatchOperationRequestDTOprotected SnDocumentBatchOperationResponseprotected DocumentBatchRequestDTOconvertDocumenBatchRequest(SnDocumentBatchRequest source, String indexerOperationId) protected SnDocumentBatchResponseprotected SnDocumentOperationStatusconvertDocumenOperationStatus(Integer statusCode) protected Stringprotected DocumentDTOconvertDocument(SnDocument source) protected FieldDTOconvertField(CSSearchSnSearchProvider.ConverterContext converterContext, SnField source) protected FieldTypeDTOconvertFieldType(SnFieldType source) protected SnIndexconvertIndex(IndexDTO source) protected IndexConfigurationDTOconvertIndexConfiguration(CSSearchSnSearchProvider.ConverterContext converterContext, SnIndexConfiguration source) protected SnIndexerOperationprotected SnIndexerOperationStatusprotected IndexerOperationStatusDTOprotected SnIndexerOperationTypeprotected IndexerOperationTypeDTOprotected IndexTypeDTOconvertIndexType(CSSearchSnSearchProvider.ConverterContext converterContext, SnIndexType source) protected LanguageDTOconvertLanguage(CSSearchSnSearchProvider.ConverterContext converterContext, SnLanguage source) protected SearchQueryDTOconvertSearchQuery(SnSearchQuery source) protected SnSearchResultconvertSearchResult(SearchResultDTO source) protected SearchToleranceDTOprotected SuggestQueryDTOconvertSuggestQuery(SnSuggestQuery source) protected SnSuggestResultconvertSuggestResult(SuggestResultDTO source) protected SynonymDictionaryDTOconvertSynonymDictionary(CSSearchSnSearchProvider.ConverterContext converterContext, SnSynonymDictionary source) protected SynonymEntryDTOconvertSynonymEntry(SnSynonymEntry source) protected CSSearchClientcreateClient(SnIndexConfiguration indexConfiguration) createIndex(SnContext context) Creates an index.createIndexerOperation(SnContext context, SnIndexerOperationType indexerOperationType, int totalItems) Creates a new indexer operation.protected StringcreateLanguageHeader(SnContext context) protected StringcreateQualifierHeader(SnContext context) voiddeleteIndex(SnContext context, String indexId) Deletes an index (if it exists).executeDocumentBatch(SnContext context, String indexId, SnDocumentBatchRequest documentBatchRequest, String indexerOperationId) Executes a document batch.voidexportConfiguration(SnExportConfiguration exportConfiguration, List<Locale> locales) Exports the configuration to the search provider.protected voidexportIndexConfiguration(CSSearchSnSearchProvider.ConverterContext converterContext, SnIndexConfiguration indexConfiguration, CSSearchClient client) protected voidexportIndexTypes(CSSearchSnSearchProvider.ConverterContext converterContext, List<SnIndexType> indexTypes, CSSearchClient client) protected voidexportSynonymDictionaries(CSSearchSnSearchProvider.ConverterContext converterContext, List<SnSynonymDictionary> synonymDictionaries, CSSearchClient client) protected booleanfilterQualifierHeader(Map.Entry<String, List<SnQualifier>> entry) protected ma.glasnost.orika.MapperFacadeprotected voidhandleRequestException(String message, Runnable handler) protected <T> ThandleRequestException(String message, Supplier<T> handler) protected voidregisterMappings(ma.glasnost.orika.MapperFactory mapperFactory) search(SnContext context, String indexId, SnSearchQuery searchQuery) Executes a search query on a specific index.voidsetApiRegistryClientService(ApiRegistryClientService apiRegistryClientService) voidsetClientFactory(ClientFactory clientFactory) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetDestinationService(DestinationService<ConsumedDestinationModel> destinationService) suggest(SnContext context, String indexId, SnSuggestQuery suggestQuery) Executes a suggest query on a specific index.updateIndexerOperationStatus(SnContext context, String indexerOperationId, SnIndexerOperationStatus status, String errorMessage) Updates the status of an indexer operation.Methods inherited from class de.hybris.platform.searchservices.spi.service.impl.AbstractSnSearchProvider
getSearchProviderConfiguration
-
Constructor Details
-
CSSearchSnSearchProvider
public CSSearchSnSearchProvider()
-
-
Method Details
-
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(SnExportConfiguration exportConfiguration, List<Locale> locales) throws SnException Description copied from interface:SnSearchProviderExports the configuration to the search provider.- Specified by:
exportConfigurationin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
exportConfiguration- - the export configuration- Throws:
SnException- if an error occurs
-
exportSynonymDictionaries
protected void exportSynonymDictionaries(CSSearchSnSearchProvider.ConverterContext converterContext, List<SnSynonymDictionary> synonymDictionaries, CSSearchClient client) throws SnException - Throws:
SnException
-
convertSynonymDictionary
protected SynonymDictionaryDTO convertSynonymDictionary(CSSearchSnSearchProvider.ConverterContext converterContext, SnSynonymDictionary source) -
convertSynonymEntry
-
exportIndexConfiguration
protected void exportIndexConfiguration(CSSearchSnSearchProvider.ConverterContext converterContext, SnIndexConfiguration indexConfiguration, CSSearchClient client) throws SnException - Throws:
SnException
-
convertIndexConfiguration
protected IndexConfigurationDTO convertIndexConfiguration(CSSearchSnSearchProvider.ConverterContext converterContext, SnIndexConfiguration source) -
convertLanguage
protected LanguageDTO convertLanguage(CSSearchSnSearchProvider.ConverterContext converterContext, SnLanguage source) -
convertCurrencyQualifierType
protected QualifierTypeDTO convertCurrencyQualifierType(CSSearchSnSearchProvider.ConverterContext converterContext, SnIndexConfiguration indexConfiguration) -
convertCurrencyQualifier
protected QualifierDTO convertCurrencyQualifier(CSSearchSnSearchProvider.ConverterContext converterContext, SnCurrency source) -
exportIndexTypes
protected void exportIndexTypes(CSSearchSnSearchProvider.ConverterContext converterContext, List<SnIndexType> indexTypes, CSSearchClient client) throws SnException - Throws:
SnException
-
convertIndexType
protected IndexTypeDTO convertIndexType(CSSearchSnSearchProvider.ConverterContext converterContext, SnIndexType source) -
convertField
protected FieldDTO convertField(CSSearchSnSearchProvider.ConverterContext converterContext, SnField source) -
convertFieldType
-
convertSearchTolerance
-
createIndex
Description copied from interface:SnSearchProviderCreates an index.- Specified by:
createIndexin interfaceSnSearchProvider<CSSearchSnSearchProviderConfiguration>- Parameters:
context- - the context- Throws:
SnException- if an error occurs
-
convertIndex
-
deleteIndex
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, String indexerOperationId, SnIndexerOperationStatus status, 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
-
convertIndexerOperationType
-
convertIndexerOperationStatus
-
convertIndexerOperationStatus
-
convertIndexerOperation
-
executeDocumentBatch
public SnDocumentBatchResponse executeDocumentBatch(SnContext context, String indexId, SnDocumentBatchRequest documentBatchRequest, 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
-
convertDocumenBatchRequest
protected DocumentBatchRequestDTO convertDocumenBatchRequest(SnDocumentBatchRequest source, String indexerOperationId) -
convertDocumenBatchOperationRequest
protected DocumentBatchOperationRequestDTO convertDocumenBatchOperationRequest(SnDocumentBatchOperationRequest source) -
convertDocumenOperationType
-
convertDocumenBatchResponse
-
convertDocumenBatchOperationResponse
protected SnDocumentBatchOperationResponse convertDocumenBatchOperationResponse(DocumentBatchOperationResponseDTO source) -
convertDocumenOperationStatus
-
commit
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, 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
-
convertSearchResult
-
suggest
public SnSuggestResult suggest(SnContext context, 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
-
convertSuggestResult
-
createLanguageHeader
-
createQualifierHeader
-
filterQualifierHeader
-
buildQualifierHeader
-
createClient
- Throws:
SnException
-
buildLocalizedName
-
handleRequestException
- Throws:
SnException
-
handleRequestException
- Throws:
SnException
-
buildRequestExceptionMessage
-
getDestinationService
-
setDestinationService
-
getApiRegistryClientService
-
setApiRegistryClientService
-
getCommonI18NService
-
setCommonI18NService
-
getClientFactory
-
setClientFactory
-