Class ShoppingSearchSortPopulator<FACET_SEARCH_CONFIG_TYPE,INDEXED_TYPE_TYPE,INDEXED_PROPERTY_TYPE>
java.lang.Object
de.hybris.platform.commerceservices.search.solrfacetsearch.populators.SearchSortPopulator<FACET_SEARCH_CONFIG_TYPE,INDEXED_PROPERTY_TYPE>
de.hybris.platform.shoppingservices.search.solrfacetsearch.populators.ShoppingSearchSortPopulator<FACET_SEARCH_CONFIG_TYPE,INDEXED_TYPE_TYPE,INDEXED_PROPERTY_TYPE>
- Type Parameters:
FACET_SEARCH_CONFIG_TYPE-INDEXED_TYPE_TYPE-INDEXED_PROPERTY_TYPE-
- All Implemented Interfaces:
de.hybris.platform.converters.Populator<SearchQueryPageableData<SolrSearchQueryData>,SolrSearchRequest<FACET_SEARCH_CONFIG_TYPE, IndexedType, INDEXED_PROPERTY_TYPE, de.hybris.platform.solrfacetsearch.search.SearchQuery, IndexedTypeSort>>
public class ShoppingSearchSortPopulator<FACET_SEARCH_CONFIG_TYPE,INDEXED_TYPE_TYPE,INDEXED_PROPERTY_TYPE>
extends de.hybris.platform.commerceservices.search.solrfacetsearch.populators.SearchSortPopulator<FACET_SEARCH_CONFIG_TYPE,INDEXED_PROPERTY_TYPE>
implements de.hybris.platform.converters.Populator<SearchQueryPageableData<SolrSearchQueryData>,SolrSearchRequest<FACET_SEARCH_CONFIG_TYPE,IndexedType,INDEXED_PROPERTY_TYPE,de.hybris.platform.solrfacetsearch.search.SearchQuery,IndexedTypeSort>>
Populator responsible for populating the currentSort in the target element and the orderSort in the searchQuery. If no sort
order is specified, the default ones are taken from the facetSearchConfig. If no default ones are specified, the last sort used
in the searchQueryData is used, and as a final fall-back the first available sort is used. This Shopping extension was created
for fixing a bug present in Travel Accelerator R5.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddSortsInSearchQuery(de.hybris.platform.solrfacetsearch.search.SearchQuery searchQuery, IndexedTypeSort indexedTypeSort) Adds the sorts in search query.protected voidfilterIndexedSorts(IndexedType indexedType, List<IndexedTypeSort> existingSorts, IndexedTypeSort sort) Filters indexed sorts.protected List<IndexedTypeSort>getFilteredSorts(IndexedType indexedType) protected IndexedTypeSortgetIndexedTypeSort(String fieldName, List<IndexedTypeSort> sorts) This method will return the IndexedTypeSort corresponding to the specified fieldNamevoidpopulate(SearchQueryPageableData<SolrSearchQueryData> source, SolrSearchRequest<FACET_SEARCH_CONFIG_TYPE, IndexedType, INDEXED_PROPERTY_TYPE, de.hybris.platform.solrfacetsearch.search.SearchQuery, IndexedTypeSort> target) protected booleansortFieldExists(String sortFieldName, IndexedType indexedType) Method checks if the field with the givensortFieldNameexists in the index configuration of theindexedType.
-
Field Details
-
SOLR_SCORE_FIELD
- See Also:
-
-
Constructor Details
-
ShoppingSearchSortPopulator
public ShoppingSearchSortPopulator()
-
-
Method Details
-
populate
public void populate(SearchQueryPageableData<SolrSearchQueryData> source, SolrSearchRequest<FACET_SEARCH_CONFIG_TYPE, IndexedType, INDEXED_PROPERTY_TYPE, de.hybris.platform.solrfacetsearch.search.SearchQuery, IndexedTypeSort> target) - Specified by:
populatein interfacede.hybris.platform.converters.Populator<FACET_SEARCH_CONFIG_TYPE,INDEXED_TYPE_TYPE> - Overrides:
populatein classde.hybris.platform.commerceservices.search.solrfacetsearch.populators.SearchSortPopulator<FACET_SEARCH_CONFIG_TYPE,INDEXED_PROPERTY_TYPE>
-
getIndexedTypeSort
This method will return the IndexedTypeSort corresponding to the specified fieldName- Parameters:
fieldName- the fieldName to be used to get the corresponding IndexedTypeSortsorts- the list of IndexedTypeSort- Returns:
- the indexedTypeSort corresponding to the specified fieldName, null if no correspondence is found
-
addSortsInSearchQuery
protected void addSortsInSearchQuery(de.hybris.platform.solrfacetsearch.search.SearchQuery searchQuery, IndexedTypeSort indexedTypeSort) Adds the sorts in search query.- Parameters:
searchQuery- the search queryindexedTypeSort- the indexed type sort
-
getFilteredSorts
-
filterIndexedSorts
protected void filterIndexedSorts(IndexedType indexedType, List<IndexedTypeSort> existingSorts, IndexedTypeSort sort) Filters indexed sorts.- Parameters:
indexedType-existingSorts-sort-
-
sortFieldExists
Method checks if the field with the givensortFieldNameexists in the index configuration of theindexedType.- Parameters:
sortFieldName-indexedType-- Returns:
- true if exists
-