GET /products/{id}
{
"id": "04b8c147-0065-4ed6-8d30-b145215d4dd6", "masterData": { "staged": { "masterVariant": { ... }, "variants": [ ... ], }, "current": { "masterVariant": { ... }, "variants": [ ... ], }, "hasStagedChanges": false, }, }
GET /products ? where={predicate}
& sort={criteria} & limit=20 & offset=0
{
"results": [
{
"id": "04b8c147-0065-4ed6-8d30-b145215d4dd6",
"masterData": {
"staged": {
"masterVariant": { ... },
},
"current": {
"masterVariant": { ... },
},
"hasStagedChanges": false,
},
}
],
"total": 100, "count": 20, "offset": 0
}
GET /product-projections/{id} ? staged=false
{
"id": "04b8c147-0065-4ed6-8d30-b145215d4dd6",
"masterVariant": { ... },
"hasStagedChanges": false,
}
GET /product-projections ? staged=false
& where={predicate} & sort={criteria}
& limit=20 & offset=0
{
"results": [
{
"id": "04b8c147-0065-4ed6-8d30-b145215d4dd6",
"masterVariant": { ... },
"hasStagedChanges": false,
}
],
"total": 100, "count": 20, "offset": 0
}
GET /product-projections/search ? lang=en & staged=false & text={search} &
facet={expression} & filter={expression} &
filter.query={expression} & filter.facets={expression}
& sort={criteria} & limit=20 & offset=0
{
"facets": { ... },
"results": [
{
"id": "04b8c147-0065-4ed6-8d30-b145215d4dd6",
"masterVariant": { ... },
"hasStagedChanges": false,
}
],
"total": 100, "count": 20, "offset": 0
}
GET /product-projections/search ? lang=de
& facet=variants.attributes.color.key
{
"facets": {
"variants.attributes.color.key": {
"terms": [
{ "count": 7, "term": "red" },
{ "count": 2, "term": "blue" }
],
"total": 9, // variants matching some returned term
"missing": 3, // variants with no matching term (no value)
"other": 0, // variants excluded from total (limit 50)
"type": "terms"
}
}
}
GET /product-projections/search ? lang=de
& facet=variants.price.centAmount: range (0 to *)
{
"facets": {
"variants.price.centAmount": {
"ranges": [
{
"mean": 16758.941464116207,
"max": 590000, "min": 50,
"from": 0, "fromStr": "0",
"to": 0, "toStr": "",
"count": 4165, "totalCount": 6953,
"total": 116524920,
}
],
"type": "range"
}
}
}
GET /product-projections/search ? lang=de
& facet=variants.attributes.color.key as myFacet
{
"facets": {
"myFacet": {
"terms": [
{ "count": 7, "term": "red" },
{ "count": 2, "term": "blue" }
],
"total": 7, // variants matching some returned term
"missing": 3, // variants with no matching term (no value)
"other": 0, // variants excluded from total (limit 50)
"type": "terms"
}
}
}
GET /product-projections/search ? lang=de
& facet=variants.attributes.color.key as myFacet
& filter.facets=myFacet: "red"
{
"facets": {
"myFacet": {
"terms": [],
"total": 0, // variants matching some returned term
"missing": 0, // variants with no matching term (no value)
"other": 0, // variants excluded from total (limit 50)
"type": "terms"
}
}
}
GET /product-projections/search ? lang=de
& facet=variants.attributes.color.key as myFacet
& filter.facets= variants.attributes.color.key : "red"
{
"facets": {
"myFacet": {
"terms": [
{ "count": 7, "term": "red" },
{ "count": 2, "term": "blue" }
],
"total": 9, // variants matching some returned term
"missing": 3, // variants with no matching term (no value)
"other": 0, // variants excluded from total (limit 50)
"type": "terms"
}
}
}
SearchRequest<Product> searchRequest = sphere.products
.filter(List<FilterExpression>)
.facet(List<FacetExpression>);