Search

ECommerce search powered by ElasticSearch

{ "data": [ { "id": "lnrxvznx", "attribute_data": { "name": { "webstore": { "en": "Jolly Ranchers Assorted Flavours Hard Candy", "fr": "Bonbons durs aux saveurs vari\u00e9es Jolly Ranchers" } } }, "max_price": 10.99, "max_price_tax": 0.55, "min_price": 5.99, "min_price_tax": 0.3, "variant_count": 1, "first_variant": "{ ... }" } ], "meta": { "sort": null, "category_page": false, "pagination": { "data": { "total": 836, "count": 30, "per_page": 30, "current_page": 1, "total_pages": 28 } }, "aggregation": { "data": { "max_price": { "value": 2912.5, "attribute": null }, "price": { "buckets": [ { "key": "Under £12.00", "from": 0, "to": 149, "doc_count": 672 }, { "key": "£13.00 - £15.00", "from": 130, "to": 150, "doc_count": 22 } ] }, "categories": { "data": "{ ... }" } } } } }
php <?php $results = CandyClient::Products()->search([ 'includes' => ['first_variant'], 'page' => 1, 'per_page' => 50, 'type' => 'product', 'sort' => 'sku:asc', 'keywords' => 'Pops', 'brand' => ['Nestle', 'Kelloggs'] ]);
Parameter Type Required Description

type

String

true

Search for either `product` or `category`

{attribute}

Array|String

false

The attribute to filter on

categories

String|Array

false

Limit to a specific categories

keywords

String

true

The keywords to search

channel

String

false

The channel to limit results by

current_page

Number|String

false

The current page

sort

String

false

The attribute to sort the results by

per_page

Number|String

false

The number of results to show per page

rank

Boolean

false

Whether to use the ranking defined in GetCandy config (defaults to true)

Model Definitions

Product