Interface ProductSearchStrategy<STATE,ITEM,SEARCH_RESULT extends ProductSearchPageData<STATE,ITEM>,AUTOCOMPLETE_RESULT extends AutocompleteSuggestion>

Type Parameters:
STATE - The type of the search query state. This is implementation specific. For example SolrSearchQueryData
ITEM - The type of items returned as part of the search results. For example SearchResultValueData
SEARCH_RESULT - The type of the search page data returned. Must be (or extend) ProductSearchPageData.
AUTOCOMPLETE_RESULT - The type of the result data structure containing the returned suggestions
All Known Subinterfaces:
SolrFacetSearchProductSearchStrategy<ITEM>
All Known Implementing Classes:
DefaultSearchServicesProductSearchStrategy, DefaultSolrFacetSearchProductSearchStrategy

public interface ProductSearchStrategy<STATE,ITEM,SEARCH_RESULT extends ProductSearchPageData<STATE,ITEM>,AUTOCOMPLETE_RESULT extends AutocompleteSuggestion>
ProductSearchStrategy interface.

Abstraction for different product search implementations.

  • Method Details

    • textSearch

      SEARCH_RESULT textSearch(String text, PageableData pageableData)
      Initiate a new search using simple free text query.
      Parameters:
      text - the search text
      pageableData - the page to return, can be null to use defaults
      Returns:
      the search results
    • textSearch

      SEARCH_RESULT textSearch(String text, SearchQueryContext searchQueryContext, PageableData pageableData)
      Initiate a new search using simple free text query in a search query context.
      Parameters:
      text - the search text
      searchQueryContext - search query context
      pageableData - the page to return, can be null to use defaults
      Returns:
      the search results
    • categorySearch

      SEARCH_RESULT categorySearch(String categoryCode, PageableData pageableData)
      Initiate a new search in category.
      Parameters:
      categoryCode - the code for category to search in
      pageableData - the page to return, can be null to use defaults
      Returns:
      the search results
    • categorySearch

      SEARCH_RESULT categorySearch(String categoryCode, SearchQueryContext searchQueryContext, PageableData pageableData)
      Initiate a new search in category in a search query context.
      Parameters:
      categoryCode - the code for category to search in
      searchQueryContext - search query context
      pageableData - the page to return, can be null to use defaults
      Returns:
      the search results
    • searchAgain

      SEARCH_RESULT searchAgain(STATE searchQueryData, PageableData pageableData)
      Refine an exiting search. The query object allows more complex queries using facet selection. The SearchQueryData must have been obtained from the results of a call to either textSearch(String, PageableData) or categorySearch(String, PageableData).
      Parameters:
      searchQueryData - the search query object
      pageableData - the page to return
      Returns:
      the search results
    • getAutocompleteSuggestions

      List<AUTOCOMPLETE_RESULT> getAutocompleteSuggestions(String input)
      Get the auto complete suggestions for the input provided.
      Parameters:
      input - the user's input on which the autocomplete is based
      Returns:
      a list of suggested search terms
    • getIndexTypes

      Set<String> getIndexTypes(String baseSiteId, String catalogId, String catalogVersion)
      Get the index types for baseSiteId, catalogId and catalogversion
      Parameters:
      baseSiteId - the base site identifier
      catalogId - the catalog identifier
      catalogVersion - the catalog version
      Returns:
      a list of suggested search terms