Interface ProductSearchService<STATE,ITEM,RESULT extends ProductSearchPageData<STATE,ITEM>>

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
RESULT - The type of the search page data returned. Must be (or extend) FacetSearchPageData.
All Known Implementing Classes:
DefaultSolrProductSearchService

public interface ProductSearchService<STATE,ITEM,RESULT extends ProductSearchPageData<STATE,ITEM>>
ProductSearchService interface. Its main purpose is to retrieve product search results. The search service implementation is stateless, i.e. it does not maintain any state for each search, instead it externalizes the search state in the search page data returned. The search must be initiated by calling either of the 2 search methods textSearch(String,PageableData) or categorySearch(String,PageableData). From these you get the search page data result FacetSearchPageData. The search page data includes state instances for each search refinement option, and to perform the refinement the searchAgain(Object, de.hybris.platform.commerceservices.search.pagedata.PageableData) method must be called passing back in the appropriate state instance. The state instance is a memento representing the search state, it is an opaque instance that only has meaning to the search service implementation. Callers should not create their own instances or modify the instances returned.
  • Method Details

    • textSearch

      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

      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

      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

      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

      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