Class SnAsSearchProvider
java.lang.Object
de.hybris.platform.adaptivesearch.searchservices.strategies.impl.SnAsSearchProvider
- All Implemented Interfaces:
AsSearchProvider,org.springframework.beans.factory.InitializingBean
public class SnAsSearchProvider
extends Object
implements AsSearchProvider, org.springframework.beans.factory.InitializingBean
Implementation of
AsSearchProvider that uses the searchservices API.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final List<AsFacetType>protected static final Set<AsFeatureFlag> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected intcompareExpressions(AsExpressionData expression1, AsExpressionData expression2) protected AsFacetValueDataconvertBucketResponse(AbstractSnBucketResponse source, Set<String> selectedBucketIds) protected AsDocumentDataconvertDocument(SnSearchHit source) protected AsExpressionDataconvertExpression(SnExpressionInfo source) protected AsFacetDataprotected AsIndexConfigurationDataprotected AsIndexPropertyDataconvertIndexProperty(SnField source) protected AsIndexTypeDataconvertIndexType(SnIndexType source) protected AsSortDataconvertNamedSort(SnNamedSort source) protected AsFacetDataprotected SnSearchQueryconvertSearchQuery(AsSearchProfileContext context, AsSearchQueryData source) protected AsSearchResultDataconvertSearchResult(SnSearchQuery searchQuery, SnSearchResult source) protected AsFacetDataprotected AsFacetSortDatacreateFacetSort(String sortId) protected PKextractPkFromSearchHit(SnSearchHit searchHit) getAvailableQualifiers(String indexType, String indexPropertyId) Return list of qualifiers for index property.protected Map<String,AsBoostOperator> Returns the index configuration for the provided code.Returns a list of index configurations.getIndexProperties(String indexTypeId) Returns a list of index properties for a given index type.getIndexPropertyForCode(String indexTypeId, String id) Returns the index property for the provided code.Returns the index type for the provided code.Returns a list of index types.getIndexTypes(String indexConfigurationId) Returns a list of index types for a given index configuration.getSupportedBoostTypes(String indexType) Returns a list of boost types for a given index type.getSupportedCatalogVersions(String indexConfigurationId, String indexTypeId) Returns a list of catalog versions for a given index configuration and type.getSupportedCurrencies(String indexConfigurationId, String indexTypeId) Returns a list of currencies for a given index configuration and type.getSupportedFacetExpressions(String indexTypeId) Returns a list of expressions for a given index type that can be used for facets.getSupportedFacetSorts(String indexType) Returns a list of facet sorts for a given index type.getSupportedFacetTypes(String indexType) Returns a list of facet types for a given index type.getSupportedFeatures(String indexType) Returns a list of supported features.getSupportedGroupExpressions(String indexTypeId) Returns a list of expressions for a given index type that can be used for groups.getSupportedLanguages(String indexConfigurationId, String indexTypeId) Returns a list of languages for a given index configuration and type.getSupportedQueryContexts(String indexType) Returns a list of supported query contexts.getSupportedSortExpressions(String indexTypeId) Returns a list of expressions for a given index type that can be used for sorts.booleanisValidBoostType(String indexType, AsBoostType boostType) Checks if a given boost type can be used for a given index type.booleanisValidFacetExpression(String indexTypeId, String expression) Checks if a given index property can be used for facets.booleanisValidFacetSort(String indexType, String sort) Checks if a given sort can be used for facets.booleanisValidFacetType(String indexType, AsFacetType facetType) Checks if a given facet type can be used for a given index type.booleanisValidGroupExpression(String indexTypeId, String expression) Checks if a given expression can be used for groups.booleanisValidSortExpression(String indexTypeId, String expression) Checks if a given expression can be used for sorts.performSearch(AsSearchProfileContext context, AsSearchQueryData query) protected voidprotected CategoryModelresolveSelectedCategory(List<CategoryModel> categoryPath) search(AsSearchProfileContext context, AsSearchQueryData searchQuery) Performs a search query.voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetI18nService(I18NService i18nService) voidsetL10nService(L10NService l10nService) voidsetSnCommonConfigurationService(SnCommonConfigurationService snCommonConfigurationService) voidsetSnContextFactory(SnContextFactory snContextFactory) voidsetSnFieldTypeRegistry(SnFieldTypeRegistry snFieldTypeRegistry) voidsetSnIndexConfigurationService(SnIndexConfigurationService snIndexConfigurationService) voidsetSnIndexTypeService(SnIndexTypeService snIndexTypeService) voidsetSnQualifierTypeFactory(SnQualifierTypeFactory snQualifierTypeFactory) voidsetSnQueryContextFactory(SnQueryContextFactory snQueryContextFactory) voidsetSnSearchService(SnSearchService snSearchService) voidsetSnSessionService(SnSessionService snSessionService) voidsetTypeService(TypeService typeService)
-
Field Details
-
SUPPORTED_FEATURES
-
SUPPORTED_FACET_TYPES
-
FACET_SORT_KEY_PREFIX
- See Also:
-
-
Constructor Details
-
SnAsSearchProvider
public SnAsSearchProvider()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
populateBoostOperatorMapping
protected void populateBoostOperatorMapping() -
getBoostOperatorMapping
-
getSupportedFeatures
Description copied from interface:AsSearchProviderReturns a list of supported features.- Specified by:
getSupportedFeaturesin interfaceAsSearchProvider- Parameters:
indexType- - the index type code- Returns:
- the supported features
-
getSupportedQueryContexts
Description copied from interface:AsSearchProviderReturns a list of supported query contexts.- Specified by:
getSupportedQueryContextsin interfaceAsSearchProvider- Returns:
- the supported query contexts
-
getIndexConfigurations
Description copied from interface:AsSearchProviderReturns a list of index configurations.- Specified by:
getIndexConfigurationsin interfaceAsSearchProvider- Returns:
- the index configurations
-
getIndexConfigurationForCode
Description copied from interface:AsSearchProviderReturns the index configuration for the provided code.- Specified by:
getIndexConfigurationForCodein interfaceAsSearchProvider- Parameters:
id- - the index configuration code- Returns:
- the index type
-
getIndexTypes
Description copied from interface:AsSearchProviderReturns a list of index types.- Specified by:
getIndexTypesin interfaceAsSearchProvider- Returns:
- the index types
-
getIndexTypes
Description copied from interface:AsSearchProviderReturns a list of index types for a given index configuration.- Specified by:
getIndexTypesin interfaceAsSearchProvider- Parameters:
indexConfigurationId- - the index configuration code- Returns:
- the index types
-
getIndexTypeForCode
Description copied from interface:AsSearchProviderReturns the index type for the provided code.- Specified by:
getIndexTypeForCodein interfaceAsSearchProvider- Parameters:
id- - the index type code- Returns:
- the index type
-
getIndexProperties
Description copied from interface:AsSearchProviderReturns a list of index properties for a given index type.- Specified by:
getIndexPropertiesin interfaceAsSearchProvider- Parameters:
indexTypeId- - the index type code- Returns:
- the index properties
-
getIndexPropertyForCode
Description copied from interface:AsSearchProviderReturns the index property for the provided code.- Specified by:
getIndexPropertyForCodein interfaceAsSearchProviderid- - the index property code- Returns:
- the index property
-
getSupportedCatalogVersions
public List<CatalogVersionModel> getSupportedCatalogVersions(String indexConfigurationId, String indexTypeId) Description copied from interface:AsSearchProviderReturns a list of catalog versions for a given index configuration and type.- Specified by:
getSupportedCatalogVersionsin interfaceAsSearchProvider- Parameters:
indexConfigurationId- - the index configurationindexTypeId- - the index type- Returns:
- the catalog versions
-
getSupportedLanguages
Description copied from interface:AsSearchProviderReturns a list of languages for a given index configuration and type.- Specified by:
getSupportedLanguagesin interfaceAsSearchProvider- Parameters:
indexConfigurationId- - the index configurationindexTypeId- - the index type- Returns:
- the languages
-
getSupportedCurrencies
Description copied from interface:AsSearchProviderReturns a list of currencies for a given index configuration and type.- Specified by:
getSupportedCurrenciesin interfaceAsSearchProvider- Parameters:
indexConfigurationId- - the index configurationindexTypeId- - the index type- Returns:
- the currencies
-
getSupportedFacetExpressions
Description copied from interface:AsSearchProviderReturns a list of expressions for a given index type that can be used for facets.- Specified by:
getSupportedFacetExpressionsin interfaceAsSearchProvider- Parameters:
indexTypeId- - the index type code- Returns:
- the expressions
-
isValidFacetExpression
Description copied from interface:AsSearchProviderChecks if a given index property can be used for facets.- Specified by:
isValidFacetExpressionin interfaceAsSearchProvider- Parameters:
indexTypeId- - the index type codeexpression- - the facet expression- Returns:
trueif expression can be used for facets,falseotherwise
-
getSupportedFacetTypes
Description copied from interface:AsSearchProviderReturns a list of facet types for a given index type.- Specified by:
getSupportedFacetTypesin interfaceAsSearchProvider- Parameters:
indexType- - the index type code- Returns:
- the facet types
-
isValidFacetType
Description copied from interface:AsSearchProviderChecks if a given facet type can be used for a given index type.- Specified by:
isValidFacetTypein interfaceAsSearchProvider- Parameters:
indexType- - the index type codefacetType- - the facet type- Returns:
trueif facet type can be used,falseotherwise
-
getSupportedFacetSorts
Description copied from interface:AsSearchProviderReturns a list of facet sorts for a given index type.- Specified by:
getSupportedFacetSortsin interfaceAsSearchProvider- Parameters:
indexType- - the index type code- Returns:
- the facet sorts
-
createFacetSort
-
isValidFacetSort
Description copied from interface:AsSearchProviderChecks if a given sort can be used for facets.- Specified by:
isValidFacetSortin interfaceAsSearchProvider- Parameters:
indexType- - the index type codesort- - the sort- Returns:
trueif sort can be used for facets,falseotherwise
-
getSupportedBoostTypes
Description copied from interface:AsSearchProviderReturns a list of boost types for a given index type.- Specified by:
getSupportedBoostTypesin interfaceAsSearchProvider- Parameters:
indexType- - the index type code- Returns:
- the boost types
-
isValidBoostType
Description copied from interface:AsSearchProviderChecks if a given boost type can be used for a given index type.- Specified by:
isValidBoostTypein interfaceAsSearchProvider- Parameters:
indexType- - the index type codeboostType- - the boost type- Returns:
trueif boost type can be used,falseotherwise
-
getSupportedSortExpressions
Description copied from interface:AsSearchProviderReturns a list of expressions for a given index type that can be used for sorts.- Specified by:
getSupportedSortExpressionsin interfaceAsSearchProvider- Parameters:
indexTypeId- - the index type code- Returns:
- the expressions
-
isValidSortExpression
Description copied from interface:AsSearchProviderChecks if a given expression can be used for sorts.- Specified by:
isValidSortExpressionin interfaceAsSearchProvider- Parameters:
indexTypeId- - the index type codeexpression- - the sort expression- Returns:
trueif expression can be used for sorts,falseotherwise
-
getSupportedGroupExpressions
Description copied from interface:AsSearchProviderReturns a list of expressions for a given index type that can be used for groups.- Specified by:
getSupportedGroupExpressionsin interfaceAsSearchProvider- Parameters:
indexTypeId- - the index type code- Returns:
- the expressions
-
isValidGroupExpression
Description copied from interface:AsSearchProviderChecks if a given expression can be used for groups.- Specified by:
isValidGroupExpressionin interfaceAsSearchProvider- Parameters:
indexTypeId- - the index type codeexpression- - the sort expression- Returns:
trueif expression can be used for groups,falseotherwise
-
getAvailableQualifiers
public List<String> getAvailableQualifiers(String indexType, String indexPropertyId) throws AsException Description copied from interface:AsSearchProviderReturn list of qualifiers for index property.- Specified by:
getAvailableQualifiersin interfaceAsSearchProvider- Parameters:
indexType- - the index type codeindexPropertyId- - the index property code- Returns:
- the qualifiers
- Throws:
AsException
-
search
public AsSearchResultData search(AsSearchProfileContext context, AsSearchQueryData searchQuery) throws AsException Description copied from interface:AsSearchProviderPerforms a search query.- Specified by:
searchin interfaceAsSearchProvider- Parameters:
context- - the search profile contextsearchQuery- - the search query- Throws:
AsException- if and exception occurs during the search
-
performSearch
public AsSearchResultData performSearch(AsSearchProfileContext context, AsSearchQueryData query) throws AsException - Throws:
AsException
-
convertSearchQuery
protected SnSearchQuery convertSearchQuery(AsSearchProfileContext context, AsSearchQueryData source) -
resolveSelectedCategory
-
convertSearchResult
-
convertIndexConfiguration
-
convertIndexType
-
convertIndexProperty
-
convertExpression
-
compareExpressions
-
convertDocument
-
convertFacetResponse
-
convertTermBucketsFacetResponse
-
convertRangeBucketsFacetResponse
-
convertBucketResponse
protected AsFacetValueData convertBucketResponse(AbstractSnBucketResponse source, Set<String> selectedBucketIds) -
convertNamedSort
-
extractPkFromSearchHit
-
getTypeService
-
setTypeService
-
getI18nService
-
setI18nService
-
getL10nService
-
setL10nService
-
getCommonI18NService
-
setCommonI18NService
-
getCatalogVersionService
-
setCatalogVersionService
-
getSnSessionService
-
setSnSessionService
-
getSnQueryContextFactory
-
setSnQueryContextFactory
-
getSnFieldTypeRegistry
-
setSnFieldTypeRegistry
-
getSnIndexConfigurationService
-
setSnIndexConfigurationService
-
getSnIndexTypeService
-
setSnIndexTypeService
-
getSnCommonConfigurationService
-
setSnCommonConfigurationService
public void setSnCommonConfigurationService(SnCommonConfigurationService snCommonConfigurationService) -
getSnQualifierTypeFactory
-
setSnQualifierTypeFactory
-
getSnContextFactory
-
setSnContextFactory
-
getSnSearchService
-
setSnSearchService
-