Fluent builder for searching products in the catalogue. Configure it with a search query, an optional product library organisation, and an optional list of supplier organisations, then call search to fetch a page of matching products, count to get the total match count, or query to build a criteria for further use. Obtained by calling newProductSearchBuilder on the catalogManager service from server-side JavaScript.
Group: Builders
Methods
search(SearchProperties searchProperties)
Returns: List<Product>
Runs the configured search and returns a page of matching products.
| Parameter | Description |
|---|---|
searchProperties | paging and sorting options for the result page |
count()
Returns: long
Runs the configured search and returns the total number of matching products, ignoring paging.
query()
Returns: KCriteria
Builds a KCriteria based on the current search builder parameters, for cases where the caller needs to stream or further filter the matching products rather than fetch a single page.
kSearchQuery(KSearchQuery s)
Returns: ProductSearchBuilder
Sets the parsed search query terms to filter products by.
| Parameter | Description |
|---|---|
s | the search query |
prodLibOrg(Long s)
Returns: ProductSearchBuilder
Sets the ID of the product library organisation to search within, instead of the current organisation.
| Parameter | Description |
|---|---|
s | the ID of the product library organisation, or null to use the current organisation |
suppliers(List<Organisation> s)
Returns: ProductSearchBuilder
Restricts the search to products from the given supplier organisations.
| Parameter | Description |
|---|---|
s | the supplier organisations to restrict the search to |