Class SolrAsSearchProvider
java.lang.Object
de.hybris.platform.adaptivesearchsolr.strategies.impl.SolrAsSearchProvider
- All Implemented Interfaces:
AsSearchProvider
Implementation of
AsSearchProvider that uses the solrfacetsearch API.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final List<AsFacetType>protected static final Set<AsFeatureFlag>protected static final Pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompareExpressions(AsExpressionData expression1, AsExpressionData expression2) protected intcompareIndexProperties(AsIndexPropertyData indexProperty1, AsIndexPropertyData indexProperty2) protected <S,T> List<T> convertAll(Collection<? extends S> source, Function<S, T> converter) protected AsExpressionDataprotected AsIndexConfigurationDataconvertIndexConfiguration(SolrFacetSearchConfigModel solrIndexConfiguration) protected AsIndexPropertyDataprotected AsIndexTypeDataconvertIndexType(SolrIndexedTypeModel source) protected SearchQueryconvertSearchQuery(AsSearchProfileContext context, AsSearchQueryData searchQuery) protected AsSearchResultDataconvertSearchResult(SearchResult result) protected AsDocumentDatacreateDocumentData(Document document) protected AsDocumentDataprotected AsFacetDatacreateFacetData(Facet facet) protected AsFacetValueDatacreateFacetValueData(FacetValue facetValue) protected AsExpressionDataprotected AsSortDataprotected AsSearchResultDataexecuteInLocalViewWithLocale(Locale localeForLanguage, Supplier<AsSearchResultData> action) protected StringextractIdFromDocument(Document document) protected PKextractPkFromDocument(Document document) protected FloatextractScoreFromDocument(Document document) getAvailableQualifiers(String indexType, String indexProperty) Return list of qualifiers for index property.Returns the index configuration for the provided code.Returns a list of index configurations.getIndexProperties(String indexType) Returns a list of index properties for a given index type.getIndexPropertyForCode(String indexType, String code) Returns the index property for the provided code.getIndexTypeForCode(String code) Returns the index type for the provided code.Returns a list of index types.getIndexTypes(String indexConfiguration) 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 indexConfiguration, String indexType) Returns a list of catalog versions for a given index configuration and type.getSupportedCurrencies(String indexConfiguration, String indexType) Returns a list of currencies for a given index configuration and type.getSupportedFacetExpressions(String indexType) 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 indexType) Returns a list of expressions for a given index type that can be used for groups.getSupportedLanguages(String indexConfiguration, String indexType) Returns a list of languages for a given index configuration and type.getSupportedQueryContexts(String indexType) Returns a list of supported query contexts.getSupportedSortExpressions(String indexType) 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 indexType, String expression) Checks if a given index property can be used for facets.protected booleanisValidFacetIndexProperty(SolrIndexedPropertyModel indexProperty) 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 indexType, String expression) Checks if a given expression can be used for groups.protected booleanisValidGroupIndexProperty(SolrIndexedPropertyModel indexProperty) booleanisValidSortExpression(String indexType, String expression) Checks if a given expression can be used for sorts.protected booleanisValidSortIndexProperty(SolrIndexedPropertyModel indexProperty) performSearch(AsSearchProfileContext context, AsSearchQueryData searchQuery) protected IndexedTyperesolveIndexedType(FacetSearchConfig facetSearchConfig, String identifier) protected CategoryModelresolveSelectedCategory(List<CategoryModel> categoryPath) search(AsSearchProfileContext context, AsSearchQueryData searchQuery) Performs a search query.voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetFacetSearchConfigService(FacetSearchConfigService facetSearchConfigService) voidsetFacetSearchService(FacetSearchService facetSearchService) voidsetI18nService(I18NService i18nService) voidsetSessionService(SessionService sessionService) voidsetSolrAsTypeMappingRegistry(SolrAsTypeMappingRegistry solrAsTypeMappingRegistry) voidsetSolrFacetSearchConfigDao(SolrFacetSearchConfigDao solrFacetSearchConfigDao) voidsetSolrIndexedPropertyDao(SolrIndexedPropertyDao solrIndexedPropertyDao) voidsetSolrIndexedPropertyTypeRegistry(SolrIndexedPropertyTypeRegistry solrIndexedPropertyTypeRegistry) voidsetSolrIndexedTypeDao(SolrIndexedTypeDao solrIndexedTypeDao) voidsetSolrQueryContextFactory(SolrQueryContextFactory solrQueryContextFactory)
-
Field Details
-
SUPPORTED_FEATURES
-
SUPPORTED_FACET_TYPES
-
INDEX_CONFIGURATION_PARAM
- See Also:
-
INDEX_TYPE_PARAM
- See Also:
-
CODE_PARAM
- See Also:
-
EXPRESSION_PARAM
- See Also:
-
DEFAULT_QUERY_TEMPLATE
- See Also:
-
ADAPTIVE_SEARCH_KEEP_EXCLUDED_VALUES_KEY
- See Also:
-
VALID_INDEX_PROPERTY_NAME_REGEX_PATTERN
-
INDEX_PROPERTY_NOT_FOUND
- See Also:
-
-
Constructor Details
-
SolrAsSearchProvider
public SolrAsSearchProvider()
-
-
Method Details
-
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:
code- - 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:
indexConfiguration- - 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:
code- - 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:
indexType- - the index type code- Returns:
- the index properties
-
getIndexPropertyForCode
Description copied from interface:AsSearchProviderReturns the index property for the provided code.- Specified by:
getIndexPropertyForCodein interfaceAsSearchProvidercode- - the index property code- Returns:
- the index property
-
getSupportedCatalogVersions
public List<CatalogVersionModel> getSupportedCatalogVersions(String indexConfiguration, String indexType) Description copied from interface:AsSearchProviderReturns a list of catalog versions for a given index configuration and type.- Specified by:
getSupportedCatalogVersionsin interfaceAsSearchProvider- Parameters:
indexConfiguration- - the index configurationindexType- - 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:
indexConfiguration- - the index configurationindexType- - 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:
indexConfiguration- - the index configurationindexType- - 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:
indexType- - 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:
indexType- - 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
-
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
-
isValidFacetIndexProperty
-
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:
indexType- - 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:
indexType- - the index type codeexpression- - the sort expression- Returns:
trueif expression can be used for sorts,falseotherwise
-
isValidSortIndexProperty
-
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:
indexType- - 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:
indexType- - the index type codeexpression- - the sort expression- Returns:
trueif expression can be used for groups,falseotherwise
-
isValidGroupIndexProperty
-
convertIndexConfiguration
protected AsIndexConfigurationData convertIndexConfiguration(SolrFacetSearchConfigModel solrIndexConfiguration) -
convertIndexType
-
convertIndexProperty
-
compareIndexProperties
protected int compareIndexProperties(AsIndexPropertyData indexProperty1, AsIndexPropertyData indexProperty2) -
createScoreSortExpression
-
convertExpression
-
compareExpressions
-
getAvailableQualifiers
public List<String> getAvailableQualifiers(String indexType, String indexProperty) throws AsException Description copied from interface:AsSearchProviderReturn list of qualifiers for index property.- Specified by:
getAvailableQualifiersin interfaceAsSearchProvider- Parameters:
indexType- - the index type codeindexProperty- - 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
-
executeInLocalViewWithLocale
protected AsSearchResultData executeInLocalViewWithLocale(Locale localeForLanguage, Supplier<AsSearchResultData> action) throws AsException - Throws:
AsException
-
performSearch
public AsSearchResultData performSearch(AsSearchProfileContext context, AsSearchQueryData searchQuery) throws AsException - Throws:
AsException
-
resolveIndexedType
protected IndexedType resolveIndexedType(FacetSearchConfig facetSearchConfig, String identifier) throws AsException - Throws:
AsException
-
resolveSelectedCategory
-
convertSearchQuery
protected SearchQuery convertSearchQuery(AsSearchProfileContext context, AsSearchQueryData searchQuery) throws FacetConfigServiceException, AsException -
convertSearchResult
-
createDocumentData
-
createDocumentData
-
createFacetData
-
createFacetValueData
-
convertAll
-
createSortData
-
extractIdFromDocument
-
extractScoreFromDocument
-
extractPkFromDocument
-
getSolrQueryContextFactory
-
setSolrQueryContextFactory
-
getSolrFacetSearchConfigDao
-
setSolrFacetSearchConfigDao
-
getSolrIndexedTypeDao
-
setSolrIndexedTypeDao
-
getSolrIndexedPropertyDao
-
setSolrIndexedPropertyDao
-
getSolrIndexedPropertyTypeRegistry
-
setSolrIndexedPropertyTypeRegistry
public void setSolrIndexedPropertyTypeRegistry(SolrIndexedPropertyTypeRegistry solrIndexedPropertyTypeRegistry) -
getSolrAsTypeMappingRegistry
-
setSolrAsTypeMappingRegistry
-
getFacetSearchService
-
setFacetSearchService
-
getFacetSearchConfigService
-
setFacetSearchConfigService
-
getSessionService
-
setSessionService
-
getI18nService
-
setI18nService
-
getCommonI18NService
-
setCommonI18NService
-