Class TravelSearchSortPopulator<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.travelservices.search.solrfacetsearch.populators.TravelSearchSortPopulator<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 TravelSearchSortPopulator<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.
  • Field Details

  • Constructor Details

    • TravelSearchSortPopulator

      public TravelSearchSortPopulator()
  • 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:
      populate in interface de.hybris.platform.converters.Populator<FACET_SEARCH_CONFIG_TYPE,INDEXED_TYPE_TYPE>
      Overrides:
      populate in class de.hybris.platform.commerceservices.search.solrfacetsearch.populators.SearchSortPopulator<FACET_SEARCH_CONFIG_TYPE,INDEXED_PROPERTY_TYPE>
    • getIndexedTypeSort

      protected IndexedTypeSort getIndexedTypeSort(String fieldName, List<IndexedTypeSort> sorts)
      This method will return the IndexedTypeSort corresponding to the specified fieldName
      Parameters:
      fieldName - the fieldName to be used to get the corresponding IndexedTypeSort
      sorts - 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 query
      indexedTypeSort - the indexed type sort
    • getFilteredSorts

      protected List<IndexedTypeSort> getFilteredSorts(IndexedType indexedType)
    • filterIndexedSorts

      protected void filterIndexedSorts(IndexedType indexedType, List<IndexedTypeSort> existingSorts, IndexedTypeSort sort)
      Filters indexed sorts.
      Parameters:
      indexedType -
      existingSorts -
      sort -
    • sortFieldExists

      protected boolean sortFieldExists(String sortFieldName, IndexedType indexedType)
      Method checks if the field with the given sortFieldName exists in the index configuration of the indexedType.
      Parameters:
      sortFieldName -
      indexedType -
      Returns:
      true if exists