Interface ResponseParser<R,T>

Type Parameters:
R - The response returned from the search engine
T - The API response converted from a search engine response, R. Typically SearchResponse

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 Type
    Method
    Description
    constructResponse(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 response
    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, 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 engine
      searchRequest - The original search request producing this response
      fieldDefinitions - An unmodifiable List of Field definitions used on the search
      page - The requested page for the search
      context - 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 engine
      searchRequest - The original search request producing this response
      fieldDefinitions - An unmodifiable List of Field Definitions used on the search
      page - The requested page for the search
      properties - Additional properties for this search
      context - The context information surrounding sandboxing/multitenant state
      Returns:
      SearchResponse representing search results