Class ProductSearchFacetDistinctValueBuilder
- All Implemented Interfaces:
Builder<ProductSearchFacetDistinctValue>
Example to create an instance using the builder pattern
ProductSearchFacetDistinctValue productSearchFacetDistinctValue = ProductSearchFacetDistinctValue.builder()
.name("{name}")
.field("{field}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ProductSearchFacetDistinctValue with checking for non-null required valuesbuilds ProductSearchFacetDistinctValue without checking for non-null required valuesThe searchable Product field to facet on.fieldType
(SearchFieldType fieldType) If thefield
is not standard, this must be the Attribute type.filter
(SearchQuery filter) Additional filtering expression to apply to the search result before calculating the facet.filter
(Function<SearchQueryBuilder, SearchQueryBuilder> builder) Additional filtering expression to apply to the search result before calculating the facet.getField()
The searchable Product field to facet on.If thefield
is not standard, this must be the Attribute type.Additional filtering expression to apply to the search result before calculating the facet.Specify which bucket keys the facets results should include.String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47.getLevel()
Specify whether to count Products (products
) or Product Variants (variants
).getLimit()
Maximum number of buckets to return.Default value to use if the specified field is not present on some Products.getName()
Name of the distinct facet to appear in the ProductSearchFacetResultBucket.getScope()
Whether the facet must consider only the Products resulting from the search (query
) or all the Products (all
).getSort()
Define how the buckets are sorted.Specify which bucket keys the facets results should include.Specify which bucket keys the facets results should include.String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47.Specify whether to count Products (products
) or Product Variants (variants
).Maximum number of buckets to return.Default value to use if the specified field is not present on some Products.Name of the distinct facet to appear in the ProductSearchFacetResultBucket.of()
factory method for an instance of ProductSearchFacetDistinctValueBuilderof
(ProductSearchFacetDistinctValue template) create builder for ProductSearchFacetDistinctValue instanceplusIncludes
(String... includes) Specify which bucket keys the facets results should include.scope
(ProductSearchFacetScopeEnum scope) Whether the facet must consider only the Products resulting from the search (query
) or all the Products (all
).Define how the buckets are sorted.sort
(Function<ProductSearchFacetDistinctBucketSortExpressionBuilder, ProductSearchFacetDistinctBucketSortExpressionBuilder> builder) Define how the buckets are sorted.withFilter
(Function<SearchQueryBuilder, SearchQuery> builder) Additional filtering expression to apply to the search result before calculating the facet.withSort
(Function<ProductSearchFacetDistinctBucketSortExpressionBuilder, ProductSearchFacetDistinctBucketSortExpression> builder) Define how the buckets are sorted.
-
Constructor Details
-
ProductSearchFacetDistinctValueBuilder
public ProductSearchFacetDistinctValueBuilder()
-
-
Method Details
-
name
Name of the distinct facet to appear in the ProductSearchFacetResultBucket.
- Parameters:
name
- value to be set- Returns:
- Builder
-
scope
Whether the facet must consider only the Products resulting from the search (
query
) or all the Products (all
).- Parameters:
scope
- value to be set- Returns:
- Builder
-
filter
public ProductSearchFacetDistinctValueBuilder filter(Function<SearchQueryBuilder, SearchQueryBuilder> builder) Additional filtering expression to apply to the search result before calculating the facet.
- Parameters:
builder
- function to build the filter value- Returns:
- Builder
-
withFilter
public ProductSearchFacetDistinctValueBuilder withFilter(Function<SearchQueryBuilder, SearchQuery> builder) Additional filtering expression to apply to the search result before calculating the facet.
- Parameters:
builder
- function to build the filter value- Returns:
- Builder
-
filter
Additional filtering expression to apply to the search result before calculating the facet.
- Parameters:
filter
- value to be set- Returns:
- Builder
-
level
public ProductSearchFacetDistinctValueBuilder level(@Nullable ProductSearchFacetCountLevelEnum level) Specify whether to count Products (
products
) or Product Variants (variants
).- Parameters:
level
- value to be set- Returns:
- Builder
-
field
The searchable Product field to facet on.
- Parameters:
field
- value to be set- Returns:
- Builder
-
includes
Specify which bucket keys the facets results should include.
- Parameters:
includes
- value to be set- Returns:
- Builder
-
includes
Specify which bucket keys the facets results should include.
- Parameters:
includes
- value to be set- Returns:
- Builder
-
plusIncludes
Specify which bucket keys the facets results should include.
- Parameters:
includes
- value to be set- Returns:
- Builder
-
sort
public ProductSearchFacetDistinctValueBuilder sort(Function<ProductSearchFacetDistinctBucketSortExpressionBuilder, ProductSearchFacetDistinctBucketSortExpressionBuilder> builder) Define how the buckets are sorted.
- Parameters:
builder
- function to build the sort value- Returns:
- Builder
-
withSort
public ProductSearchFacetDistinctValueBuilder withSort(Function<ProductSearchFacetDistinctBucketSortExpressionBuilder, ProductSearchFacetDistinctBucketSortExpression> builder) Define how the buckets are sorted.
- Parameters:
builder
- function to build the sort value- Returns:
- Builder
-
sort
public ProductSearchFacetDistinctValueBuilder sort(@Nullable ProductSearchFacetDistinctBucketSortExpression sort) Define how the buckets are sorted.
- Parameters:
sort
- value to be set- Returns:
- Builder
-
limit
Maximum number of buckets to return.
- Parameters:
limit
- value to be set- Returns:
- Builder
-
language
String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example:
en
,en-US
,zh-Hans-SG
.- Parameters:
language
- value to be set- Returns:
- Builder
-
fieldType
If the
field
is not standard, this must be the Attribute type.- Parameters:
fieldType
- value to be set- Returns:
- Builder
-
missing
Default value to use if the specified field is not present on some Products.
- Parameters:
missing
- value to be set- Returns:
- Builder
-
getName
Name of the distinct facet to appear in the ProductSearchFacetResultBucket.
- Returns:
- name
-
getScope
Whether the facet must consider only the Products resulting from the search (
query
) or all the Products (all
).- Returns:
- scope
-
getFilter
Additional filtering expression to apply to the search result before calculating the facet.
- Returns:
- filter
-
getLevel
Specify whether to count Products (
products
) or Product Variants (variants
).- Returns:
- level
-
getField
The searchable Product field to facet on.
- Returns:
- field
-
getIncludes
Specify which bucket keys the facets results should include.
- Returns:
- includes
-
getSort
Define how the buckets are sorted.
- Returns:
- sort
-
getLimit
Maximum number of buckets to return.
- Returns:
- limit
-
getLanguage
String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example:
en
,en-US
,zh-Hans-SG
.- Returns:
- language
-
getFieldType
If the
field
is not standard, this must be the Attribute type.- Returns:
- fieldType
-
getMissing
Default value to use if the specified field is not present on some Products.
- Returns:
- missing
-
build
builds ProductSearchFacetDistinctValue with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductSearchFacetDistinctValue>
- Returns:
- ProductSearchFacetDistinctValue
-
buildUnchecked
builds ProductSearchFacetDistinctValue without checking for non-null required values- Returns:
- ProductSearchFacetDistinctValue
-
of
factory method for an instance of ProductSearchFacetDistinctValueBuilder- Returns:
- builder
-
of
create builder for ProductSearchFacetDistinctValue instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-