Skip to main content

Search products with a text query

Search across product names, descriptions, SKUs and other text fields.

Query

query SearchProducts($term: String!, $language: String!, $page: Int, $offset: Int) {
products(input: {
term: $term
language: $language
page: $page
offset: $offset
}) {
itemsFound
page
pages
items {
... on Product {
productId
sku
names { language value }
manufacturer
}
... on Cluster {
clusterId
names { language value }
}
}
}
}

Variables

{
"term": "laptop",
"language": "NL",
"page": 1,
"offset": 12
}

Response

{
"data": {
"products": {
"itemsFound": 5,
"page": 1,
"pages": 1,
"items": [
{
"productId": 1895,
"sku": "HP-450G10-I5",
"names": [{ "language": "NL", "value": "HP ProBook 450 G10 i5" }],
"manufacturer": "HP"
},
{
"productId": 1920,
"sku": "LN-T14S-G4",
"names": [{ "language": "NL", "value": "Lenovo ThinkPad T14s Gen 4" }],
"manufacturer": "Lenovo"
}
]
}
}
}

How it works

The language variable determines which localized content is searched. Results include both Products and Clusters — use inline fragments (... on Product, ... on Cluster) to access type-specific fields. To limit results to one type, add class: PRODUCT or class: CLUSTER to the input. There is no separate clusters query — always use products with class: CLUSTER to search clusters.

See also