Search Behavior
info
Learn about the search feature
Unchained allows you to search and filter products and assortments.
Products Search
There are two ways to search for products in Unchained:
-
General Search: Search all products in your system.
query searchProducts($queryString: String, $limit: Int) {
searchProducts(queryString: $queryString, includeInactive: true) {
products {
_id
status
texts {
_id
title
description
}
media(limit: $limit) {
texts {
_id
title
}
file {
_id
url
name
}
}
}
}
}Options include
orderBy
,includeInactive
, andassortmentId
. -
Assortment Search: Search products attached to a specific assortment.
query Assortment($assortmentId: ID) {
assortment(assortmentId: $assortmentId) {
searchProducts {
filteredProducts
filters {
filteredProducts
definition {
_id
}
isSelected
options {
filteredProducts
definition {
_id
}
isSelected
}
}
products {
_id
}
}
}
}
Assortments Search
Similar to the general product search, you can search for assortments:
query searchAssortments($queryString: String) {
searchAssortments(queryString: $queryString, includeInactive: true) {
assortments {
_id
isActive
texts {
_id
title
description
}
}
}
}