Interface ProductSearchRequest


public interface ProductSearchRequest
ProductSearchRequest
Example to create an instance using the builder pattern

     ProductSearchRequest productSearchRequest = ProductSearchRequest.builder()
             .build()
 
  • Method Details

    • getQuery

      @Valid @Valid SearchQuery getQuery()

      The search query against searchable Product fields.

      Returns:
      query
    • getSort

      @Valid @Valid List<SearchSorting> getSort()

      Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

      Returns:
      sort
    • getLimit

      Integer getLimit()

      The maximum number of search results to be returned.

      Returns:
      limit
    • getOffset

      Integer getOffset()

      The number of search results to be skipped in the response for pagination.

      Returns:
      offset
    • getMarkMatchingVariants

      Boolean getMarkMatchingVariants()

      The search can return Products where not all Product Variants match the search criteria. If true, the response will include a field called matchingVariants that contains the sku of Product Variants that match the search query. If the query does not specify any variant-level criteria, matchingVariants will be null signifying that all Product Variants are a match.

      Returns:
      markMatchingVariants
    • getProductProjectionParameters

      @Valid @Valid ProductSearchProjectionParams getProductProjectionParameters()

      Set this field to {} to get the ProductProjection included in the ProductSearchResult. Include query parameters for controlling Reference Expansion or projections according to your needs. If not set, the result does not include the Product Projection.

      Returns:
      productProjectionParameters
    • getFacets

      @Valid @Valid List<ProductSearchFacetExpression> getFacets()

      Set this field to request facets.

      Returns:
      facets
    • getPostFilter

      @Valid @Valid SearchQuery getPostFilter()

      Specify an additional filter on the result of the query after the API calculated facets. This feature assists you in implementing faceted search.

      Returns:
      postFilter
    • setQuery

      void setQuery(SearchQuery query)

      The search query against searchable Product fields.

      Parameters:
      query - value to be set
    • setSort

      void setSort(SearchSorting... sort)

      Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

      Parameters:
      sort - values to be set
    • setSort

      void setSort(List<SearchSorting> sort)

      Controls how results to your query are sorted. If not provided, the results are sorted by relevance in descending order.

      Parameters:
      sort - values to be set
    • setLimit

      void setLimit(Integer limit)

      The maximum number of search results to be returned.

      Parameters:
      limit - value to be set
    • setOffset

      void setOffset(Integer offset)

      The number of search results to be skipped in the response for pagination.

      Parameters:
      offset - value to be set
    • setMarkMatchingVariants

      void setMarkMatchingVariants(Boolean markMatchingVariants)

      The search can return Products where not all Product Variants match the search criteria. If true, the response will include a field called matchingVariants that contains the sku of Product Variants that match the search query. If the query does not specify any variant-level criteria, matchingVariants will be null signifying that all Product Variants are a match.

      Parameters:
      markMatchingVariants - value to be set
    • setProductProjectionParameters

      void setProductProjectionParameters(ProductSearchProjectionParams productProjectionParameters)

      Set this field to {} to get the ProductProjection included in the ProductSearchResult. Include query parameters for controlling Reference Expansion or projections according to your needs. If not set, the result does not include the Product Projection.

      Parameters:
      productProjectionParameters - value to be set
    • setFacets

      void setFacets(ProductSearchFacetExpression... facets)

      Set this field to request facets.

      Parameters:
      facets - values to be set
    • setFacets

      void setFacets(List<ProductSearchFacetExpression> facets)

      Set this field to request facets.

      Parameters:
      facets - values to be set
    • setPostFilter

      void setPostFilter(SearchQuery postFilter)

      Specify an additional filter on the result of the query after the API calculated facets. This feature assists you in implementing faceted search.

      Parameters:
      postFilter - value to be set
    • of

      static ProductSearchRequest of()
      factory method
      Returns:
      instance of ProductSearchRequest
    • of

      factory method to create a shallow copy ProductSearchRequest
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ProductSearchRequest
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ProductSearchRequestBuilder builder()
      builder factory method for ProductSearchRequest
      Returns:
      builder
    • builder

      create builder for ProductSearchRequest instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductSearchRequest

      default <T> T withProductSearchRequest(Function<ProductSearchRequest,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ProductSearchRequest> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference