Interface ResponseParser<R,T>
- Type Parameters:
R- The response returned from the search engineT- The API response converted from a search engine response, R. TypicallySearchResponse
public interface ResponseParser<R,T>
Handles converting a query response from a search engine to a response to return to a consumer.
-
Method Summary
Modifier and TypeMethodDescriptionconstructResponse(R queryResponse, com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Create the search response from the search engine query responseconstructResponse(R queryResponse, com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, org.springframework.data.domain.Pageable page, SearchRequestProperties properties, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Create the search response from the search engine query response
-
Method Details
-
constructResponse
T constructResponse(R queryResponse, com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) throws com.broadleafcommerce.search.api.SearchException Create the search response from the search engine query response- Parameters:
queryResponse- The query response from the search enginesearchRequest- The original search request producing this responsefieldDefinitions- An unmodifiable List of Field definitions used on the searchpage- The requested page for the searchcontext- The context information surrounding sandboxing/multitenant state- Returns:
- SearchResponse representing search results
- Throws:
com.broadleafcommerce.search.api.SearchException- if an error occurs parsing the search response
-
constructResponse
T constructResponse(R queryResponse, com.broadleafcommerce.search.api.domain.SearchRequest searchRequest, List<com.broadleafcommerce.search.api.domain.FieldDefinition> fieldDefinitions, org.springframework.data.domain.Pageable page, SearchRequestProperties properties, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Create the search response from the search engine query response- Parameters:
queryResponse- The query response from the search enginesearchRequest- The original search request producing this responsefieldDefinitions- An unmodifiable List of Field Definitions used on the searchpage- The requested page for the searchproperties- Additional properties for this searchcontext- The context information surrounding sandboxing/multitenant state- Returns:
- SearchResponse representing search results
-