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 methodstextSearch(String,PageableData)orcategorySearch(String,PageableData). From these you get the search page data resultFacetSearchPageData. The search page data includes state instances for each search refinement option, and to perform the refinement thesearchAgain(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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RESULTcategorySearch(java.lang.String categoryCode, SearchQueryContext searchQueryContext, PageableData pageableData)Initiate a new search in category in a search query context.RESULTcategorySearch(java.lang.String categoryCode, PageableData pageableData)Initiate a new search in category.RESULTsearchAgain(STATE searchQueryData, PageableData pageableData)Refine an exiting search.RESULTtextSearch(java.lang.String text, SearchQueryContext searchQueryContext, PageableData pageableData)Initiate a new search using simple free text query in a search query context.RESULTtextSearch(java.lang.String text, PageableData pageableData)Initiate a new search using simple free text query.
-
-
-
Method Detail
-
textSearch
RESULT textSearch(java.lang.String text, PageableData pageableData)
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
RESULT textSearch(java.lang.String text, SearchQueryContext searchQueryContext, PageableData pageableData)
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
RESULT categorySearch(java.lang.String categoryCode, PageableData pageableData)
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(java.lang.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
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 eithertextSearch(String,PageableData)orcategorySearch(String,PageableData).- Parameters:
searchQueryData- the search query objectpageableData- the page to return- Returns:
- the search results
-
-