JSON API
...
Examples
Batch Updates

Visibility

1min

By default, all the products that are indexed will be available in search and category API. For any reason, if there is a requirement that the product should be visible in any one of those or should not be coming up in either of those APIs, then it can be achieved by indexing the products with a special visibility attribute.

Kindly refer to the Search API document on how to use the visibility feature at the storefront API. Following is the example of indexing the visibility value for different products for different use cases. “search” is used to make the product visible in Search API and “catalog” is used for Category pages.

[ { "id": "1", "type": "KLEVU_PRODUCT", "attributes": { "name": { "default": "Product 1" }, "brand" : "UCB", "size" : "s", "visibility": [ "search" ] } }, { "id": "2", "type": "KLEVU_PRODUCT", "attributes": { "name": { "default": "Product 2" }, "brand" : "UCB", "size" : "m", "visibility": [ "catalog" ] } }, { "id": "3", "type": "KLEVU_PRODUCT", "attributes": { "name": { "default": "Product 3" }, "brand" : "UCB", "size" : "l", "visibility": [ "search", "catalog" ] } } ]

In case you are using the visibility feature, then remember to index the visibility with both search and catalog for all the products that should be visible at both places.



Updated 11 Jul 2024
Doc contributor
Doc contributor
Doc contributor
Did this page help you?