Given a product master P1 called “Sweater” with attributes color and size that has the following variants:
V1 - color: red, size: small
V2 - color: red, size: large
V3 - color: blue, size: small
V4 - color: blue, size: large
V5 - color: yellow, size: small
V6 - color: yellow, size: large
A search for “red sweater” should hit the first two variants, V1 and V2
that are both red. The ProductSearchHit for this result encompass the master and the red variants but not the other
non-relevant variants.
The variants hit by the query can be retrieved by getRepresentedProducts(), returning a list that contains the two red sweater variants.
The master product “Sweater” is returned by getProduct().
Furthermore, to get the first or last of that list of variants hit by the query we can call
getFirstRepresentedProduct() or getLastRepresentedProduct(). The product with the highest
sort rank is returned first, and the product with the lowest sort rank is
returned last. The product sort rank depends on the sorting conditions
used for the search query.
Returns the ID of the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query.
Returns the ID of the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query.
Returns the ID of the product that is actually hit by the search and has the highest sort rank according to the sorting conditions used for the search query.
Returns the ID of the product that is actually hit by the search and has the lowest sort rank according to the sorting conditions used for the search query.
Constant representing a product search hit type based on the presentation product of a hit. This hit type is used with single, non-complex products, including product variants that
are assigned to a category and are returned as the presentation product.
Returns the ID of the product that is actually hit by the search and has the highest
sort rank according to the sorting conditions used for the search query.
Returns the ID of the product that is actually hit by the search and has the lowest
sort rank according to the sorting conditions used for the search query.
Returns the maximum price of all products represented by the
product hit. See getRepresentedProducts() for details on
the set of products used for finding the maximum. The method returns
N/A in case no price information can be found.
Note: The method uses price information of the search index and therefore
might return different prices than the ProductPriceModel.
Returns the maximum price per unit of all products represented by the
product hit. See getRepresentedProducts() for details on
the set of products used for finding the maximum. The method returns
N/A in case no price information can be found.
Note: The method uses price information of the search index and therefore
might return different prices than the ProductPriceModel.
Returns the minimum price of all products represented by the
product hit. See getRepresentedProducts() for details on
the set of products used for finding the minimum. The method returns
N/A in case no price information can be found.
Note: the method uses price information of the search index and therefore
might return different prices than the ProductPriceModel.
Returns the minimum price per unit of all products represented by the
product hit. See getRepresentedProducts() for details on
the set of products used for finding the minimum. The method returns
N/A in case no price information can be found.
Note: the method uses price information of the search index and therefore
might return different prices than the ProductPriceModel.
The method returns the actual ID of the product that is conforming the query and is represented by the search hit.
Depending on the hit typ, it returns the ID of:
If the method returns multiple products, the product with the highest
sort rank is returned first, and the product with the lowest sort rank is
returned last. The product sort rank depends on the sorting conditions
used for the search query.
The method returns the actual product that is conforming the query and is represented by the search hit.
Depending on the hit typ, getRepresentedProducts() returns:
If the method returns multiple products, the product with the highest
sort rank is returned first, and the product with the lowest sort rank is
returned last. The product sort rank depends on the sorting conditions
used for the search query.
Returns the ID of the product that is actually hit by the search and has the highest
sort rank according to the sorting conditions used for the search query.
Returns:
the ID of the first product that is actually hit by the search
Returns the ID of the product that is actually hit by the search and has the lowest
sort rank according to the sorting conditions used for the search query.
Returns:
the ID of the last product that is actually hit by the search
Returns the maximum price of all products represented by the
product hit. See getRepresentedProducts() for details on
the set of products used for finding the maximum. The method returns
N/A in case no price information can be found.
Note: The method uses price information of the search index and therefore
might return different prices than the ProductPriceModel.
Returns:
the maximum price of all products represented by the product hit.
Returns the maximum price per unit of all products represented by the
product hit. See getRepresentedProducts() for details on
the set of products used for finding the maximum. The method returns
N/A in case no price information can be found.
Note: The method uses price information of the search index and therefore
might return different prices than the ProductPriceModel.
Returns:
the maximum price per unit of all products represented by the product hit.
Returns the minimum price of all products represented by the
product hit. See getRepresentedProducts() for details on
the set of products used for finding the minimum. The method returns
N/A in case no price information can be found.
Note: the method uses price information of the search index and therefore
might return different prices than the ProductPriceModel.
Returns:
the minimum price of all products represented by the product hit.
Returns the minimum price per unit of all products represented by the
product hit. See getRepresentedProducts() for details on
the set of products used for finding the minimum. The method returns
N/A in case no price information can be found.
Note: the method uses price information of the search index and therefore
might return different prices than the ProductPriceModel.
Returns:
the minimum price per unit of all products represented by the product hit.
The method returns the actual ID of the product that is conforming the query and is represented by the search hit.
Depending on the hit typ, it returns the ID of:
If the method returns multiple products, the product with the highest
sort rank is returned first, and the product with the lowest sort rank is
returned last. The product sort rank depends on the sorting conditions
used for the search query.
Returns:
a sorted list of products represented by the wrapped product.
The method returns the actual product that is conforming the query and is represented by the search hit.
Depending on the hit typ, getRepresentedProducts() returns:
If the method returns multiple products, the product with the highest
sort rank is returned first, and the product with the lowest sort rank is
returned last. The product sort rank depends on the sorting conditions
used for the search query.
Returns:
a sorted list of products represented by the wrapped product.
This method is only applicable if this ProductSearchHit represents a
product variation (see getRepresentedProducts()). It returns the
distinct value set for the specified variation attribute for all variants
represented by this ProductSearchHit. The values are returned in the same
order as they are defined for the variation.
This method will accept a ProductVariationAttribute parameter or a String
which is the ID of a variation attribute. If any other object type is
passed, or null is passed, an exception will be thrown. If this
ProductSearchHit does not represent a product variation, or the passed
variation attribute is not associated with this product, the method
returns an empty list.
Parameters:
va - the product variation attribute, specified as either a ProductVariationAttribute or a String which is the ID of a variation attribute associated with this product.
Returns:
a list containing all distinct ProductVariationAttributeValues.