Interface ProductSearchService<STATE,ITEM,RESULT extends ProductSearchPageData<STATE,ITEM>>
- Type Parameters:
STATE- The type of the search query state. This is implementation specific. For exampleSolrSearchQueryDataITEM- The type of items returned as part of the search results. For exampleSearchResultValueDataRESULT- 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 Summary
Modifier and TypeMethodDescriptioncategorySearch(String categoryCode, SearchQueryContext searchQueryContext, PageableData pageableData) Initiate a new search in category in a search query context.categorySearch(String categoryCode, PageableData pageableData) Initiate a new search in category.searchAgain(STATE searchQueryData, PageableData pageableData) Refine an exiting search.textSearch(String text, SearchQueryContext searchQueryContext, PageableData pageableData) Initiate a new search using simple free text query in a search query context.textSearch(String text, PageableData pageableData) Initiate a new search using simple free text query.
-
Method Details
-
textSearch
Initiate a new search using simple free text query.- Parameters:
text- the search textpageableData- the page to return, can be null to use defaults- Returns:
- the search results
-
textSearch
Initiate a new search using simple free text query in a search query context.- Parameters:
text- the search textsearchQueryContext- search query contextpageableData- the page to return, can be null to use defaults- Returns:
- the search results
-
categorySearch
Initiate a new search in category.- Parameters:
categoryCode- the code for category to search inpageableData- 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 insearchQueryContext- search query contextpageableData- the page to return, can be null to use defaults- Returns:
- the search results
-
searchAgain
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 eithertextSearch(String,PageableData)orcategorySearch(String,PageableData).- Parameters:
searchQueryData- the search query objectpageableData- the page to return- Returns:
- the search results
-