Class ProductSearchRequestBuilder
- All Implemented Interfaces:
Builder<ProductSearchRequest>
Example to create an instance using the builder pattern
ProductSearchRequest productSearchRequest = ProductSearchRequest.builder()
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSet this field to request facets.addSort
(Function<SearchSortingBuilder, SearchSorting> builder) Controls how results to your query are sorted.build()
builds ProductSearchRequest with checking for non-null required valuesbuilds ProductSearchRequest without checking for non-null required valuesfacets
(ProductSearchFacetExpression... facets) Set this field to request facets.facets
(List<ProductSearchFacetExpression> facets) Set this field to request facets.Set this field to request facets.getLimit()
The maximum number of search results to be returned in one page.The search can return Products where not all Product Variants match the search criteria.The number of search results to be skipped in the response for pagination.Specify an additional filter on the result of thequery
after the API calculatedfacets
.Controls data integration with Product Projection parameters.getQuery()
The search query against searchable Product fields.getSort()
Controls how results to your query are sorted.The maximum number of search results to be returned in one page.markMatchingVariants
(Boolean markMatchingVariants) The search can return Products where not all Product Variants match the search criteria.static ProductSearchRequestBuilder
of()
factory method for an instance of ProductSearchRequestBuilderstatic ProductSearchRequestBuilder
of
(ProductSearchRequest template) create builder for ProductSearchRequest instanceThe number of search results to be skipped in the response for pagination.plusFacets
(ProductSearchFacetExpression... facets) Set this field to request facets.plusFacets
(Function<ProductSearchFacetExpressionBuilder, ProductSearchFacetExpressionBuilder> builder) Set this field to request facets.plusSort
(SearchSorting... sort) Controls how results to your query are sorted.Controls how results to your query are sorted.postFilter
(SearchQuery postFilter) Specify an additional filter on the result of thequery
after the API calculatedfacets
.Specify an additional filter on the result of thequery
after the API calculatedfacets
.productProjectionParameters
(ProductSearchProjectionParams productProjectionParameters) Controls data integration with Product Projection parameters.productProjectionParameters
(Function<ProductSearchProjectionParamsBuilder, ProductSearchProjectionParamsBuilder> builder) Controls data integration with Product Projection parameters.query
(SearchQuery query) The search query against searchable Product fields.query
(Function<SearchQueryBuilder, SearchQueryBuilder> builder) The search query against searchable Product fields.Set this field to request facets.setSort
(Function<SearchSortingBuilder, SearchSorting> builder) Controls how results to your query are sorted.sort
(SearchSorting... sort) Controls how results to your query are sorted.sort
(List<SearchSorting> sort) Controls how results to your query are sorted.withFacets
(Function<ProductSearchFacetExpressionBuilder, ProductSearchFacetExpressionBuilder> builder) Set this field to request facets.withPostFilter
(Function<SearchQueryBuilder, SearchQuery> builder) Specify an additional filter on the result of thequery
after the API calculatedfacets
.withProductProjectionParameters
(Function<ProductSearchProjectionParamsBuilder, ProductSearchProjectionParams> builder) Controls data integration with Product Projection parameters.withQuery
(Function<SearchQueryBuilder, SearchQuery> builder) The search query against searchable Product fields.Controls how results to your query are sorted.
-
Constructor Details
-
ProductSearchRequestBuilder
public ProductSearchRequestBuilder()
-
-
Method Details
-
query
The search query against searchable Product fields.
- Parameters:
builder
- function to build the query value- Returns:
- Builder
-
withQuery
The search query against searchable Product fields.
- Parameters:
builder
- function to build the query value- Returns:
- Builder
-
query
The search query against searchable Product fields.
- Parameters:
query
- value to be set- Returns:
- Builder
-
sort
Controls how results to your query are sorted. If not provided, the results are sorted by relevance score in descending order.
- Parameters:
sort
- value to be set- Returns:
- Builder
-
sort
Controls how results to your query are sorted. If not provided, the results are sorted by relevance score in descending order.
- Parameters:
sort
- value to be set- Returns:
- Builder
-
plusSort
Controls how results to your query are sorted. If not provided, the results are sorted by relevance score in descending order.
- Parameters:
sort
- value to be set- Returns:
- Builder
-
plusSort
public ProductSearchRequestBuilder plusSort(Function<SearchSortingBuilder, SearchSortingBuilder> builder) Controls how results to your query are sorted. If not provided, the results are sorted by relevance score in descending order.
- Parameters:
builder
- function to build the sort value- Returns:
- Builder
-
withSort
public ProductSearchRequestBuilder withSort(Function<SearchSortingBuilder, SearchSortingBuilder> builder) Controls how results to your query are sorted. If not provided, the results are sorted by relevance score in descending order.
- Parameters:
builder
- function to build the sort value- Returns:
- Builder
-
addSort
Controls how results to your query are sorted. If not provided, the results are sorted by relevance score in descending order.
- Parameters:
builder
- function to build the sort value- Returns:
- Builder
-
setSort
Controls how results to your query are sorted. If not provided, the results are sorted by relevance score in descending order.
- Parameters:
builder
- function to build the sort value- Returns:
- Builder
-
limit
The maximum number of search results to be returned in one page.
- Parameters:
limit
- value to be set- Returns:
- Builder
-
offset
The number of search results to be skipped in the response for pagination.
- Parameters:
offset
- value to be set- Returns:
- Builder
-
markMatchingVariants
The search can return Products where not all Product Variants match the search criteria. If
true
, the response will include a field calledmatchingVariants
that contains thesku
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- Returns:
- Builder
-
productProjectionParameters
public ProductSearchRequestBuilder productProjectionParameters(Function<ProductSearchProjectionParamsBuilder, ProductSearchProjectionParamsBuilder> builder) Controls data integration with Product Projection parameters. If not set, the result does not include the Product Projection.
- Parameters:
builder
- function to build the productProjectionParameters value- Returns:
- Builder
-
withProductProjectionParameters
public ProductSearchRequestBuilder withProductProjectionParameters(Function<ProductSearchProjectionParamsBuilder, ProductSearchProjectionParams> builder) Controls data integration with Product Projection parameters. If not set, the result does not include the Product Projection.
- Parameters:
builder
- function to build the productProjectionParameters value- Returns:
- Builder
-
productProjectionParameters
public ProductSearchRequestBuilder productProjectionParameters(@Nullable ProductSearchProjectionParams productProjectionParameters) Controls data integration with Product Projection parameters. If not set, the result does not include the Product Projection.
- Parameters:
productProjectionParameters
- value to be set- Returns:
- Builder
-
facets
Set this field to request facets.
- Parameters:
facets
- value to be set- Returns:
- Builder
-
facets
Set this field to request facets.
- Parameters:
facets
- value to be set- Returns:
- Builder
-
plusFacets
Set this field to request facets.
- Parameters:
facets
- value to be set- Returns:
- Builder
-
plusFacets
public ProductSearchRequestBuilder plusFacets(Function<ProductSearchFacetExpressionBuilder, ProductSearchFacetExpressionBuilder> builder) Set this field to request facets.
- Parameters:
builder
- function to build the facets value- Returns:
- Builder
-
withFacets
public ProductSearchRequestBuilder withFacets(Function<ProductSearchFacetExpressionBuilder, ProductSearchFacetExpressionBuilder> builder) Set this field to request facets.
- Parameters:
builder
- function to build the facets value- Returns:
- Builder
-
addFacets
public ProductSearchRequestBuilder addFacets(Function<ProductSearchFacetExpressionBuilder, ProductSearchFacetExpression> builder) Set this field to request facets.
- Parameters:
builder
- function to build the facets value- Returns:
- Builder
-
setFacets
public ProductSearchRequestBuilder setFacets(Function<ProductSearchFacetExpressionBuilder, ProductSearchFacetExpression> builder) Set this field to request facets.
- Parameters:
builder
- function to build the facets value- Returns:
- Builder
-
postFilter
public ProductSearchRequestBuilder postFilter(Function<SearchQueryBuilder, SearchQueryBuilder> builder) Specify an additional filter on the result of the
query
after the API calculatedfacets
. This feature assists you in implementing faceted search.- Parameters:
builder
- function to build the postFilter value- Returns:
- Builder
-
withPostFilter
Specify an additional filter on the result of the
query
after the API calculatedfacets
. This feature assists you in implementing faceted search.- Parameters:
builder
- function to build the postFilter value- Returns:
- Builder
-
postFilter
Specify an additional filter on the result of the
query
after the API calculatedfacets
. This feature assists you in implementing faceted search.- Parameters:
postFilter
- value to be set- Returns:
- Builder
-
getQuery
The search query against searchable Product fields.
- Returns:
- query
-
getSort
Controls how results to your query are sorted. If not provided, the results are sorted by relevance score in descending order.
- Returns:
- sort
-
getLimit
The maximum number of search results to be returned in one page.
- Returns:
- limit
-
getOffset
The number of search results to be skipped in the response for pagination.
- Returns:
- offset
-
getMarkMatchingVariants
The search can return Products where not all Product Variants match the search criteria. If
true
, the response will include a field calledmatchingVariants
that contains thesku
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
Controls data integration with Product Projection parameters. If not set, the result does not include the Product Projection.
- Returns:
- productProjectionParameters
-
getFacets
Set this field to request facets.
- Returns:
- facets
-
getPostFilter
Specify an additional filter on the result of the
query
after the API calculatedfacets
. This feature assists you in implementing faceted search.- Returns:
- postFilter
-
build
builds ProductSearchRequest with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductSearchRequest>
- Returns:
- ProductSearchRequest
-
buildUnchecked
builds ProductSearchRequest without checking for non-null required values- Returns:
- ProductSearchRequest
-
of
factory method for an instance of ProductSearchRequestBuilder- Returns:
- builder
-
of
create builder for ProductSearchRequest instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-