More in Learn

Discovery browse queries

The browse query is ideal when retrieving data from a single specific shape in Crystallize. It provides a fully semantic API, where the structure of the response mirrors the naming of your shapes and components.

Search

A search within a browse query? Yes. The browse query allows full search capabilities while maintaining a semantic response. Unlike the standard search query, it does not require inline fragments (e.g., ... on myshape) to structure results based on shape. This simplifies the response format while preserving relevance.

To perform a search within your browse query, you must provide a search term. This searches for an exact match within your browse results.

If you want to allow for minor misspellings, you can enable the fuzzy option. Fuzziness can be set to NONE, SINGLE, or DOUBLE, which defines the maximum number of single-character edits allowed to match the search term.

  • NONE means only exact matches are returned.
  • SINGLE allows one character difference (e.g., "cart" matching "cat").
  • DOUBLE allows up to two character differences (e.g., "color" matching "colur").
Circle loading spinnerImage of a partial circle indicating &qoute;loading&qoute;.Fetching snippet...

Filtering

You can filter results based on both core fields and component values, helping you find exactly what you need.

Examples of core fields you can filter on are:

  • Name
  • Variant name
  • SKU
  • Prices
  • Stock values
  • Path
  • Topics

Component-level filters depend on the specific components in your shape. The available filters for your setup can be found in the Playground documentation within the Discovery API for your tenant.

Circle loading spinnerImage of a partial circle indicating &qoute;loading&qoute;.Fetching snippet...

Faceting

Search faceting allows you to refine results using structured filters, often used in UI to help users narrow down results dynamically based on predefined categories or attributes.

You can apply faceting to both core fields and many component values within your shape. To see the exact faceting options available for your tenant, refer to the Playground documentation, which reflects the shapes and components defined for your setup.

Circle loading spinnerImage of a partial circle indicating &qoute;loading&qoute;.Fetching snippet...

Sorting

You can sort results (hits) based on both core attributes and component values. Multiple sorting methods can be combined, using either ascending or descending order.

To view the full list of sorting options available for your tenant, check the Playground documentation.

Circle loading spinnerImage of a partial circle indicating &qoute;loading&qoute;.Fetching snippet...

Pagination & Efficient Data Fetching

When retrieving data from Crystallize, it’s important to fetch in batches. Avoid requesting more component data and relations than necessary, and limit the number of results fetched at once.

While there is no strict limit on batch size, we recommend using pagination to retrieve only the data needed initially. The optimal batch size depends on payload complexity:

  • If fetching large datasets (e.g., 50 components per item, each with 10 relations and multiple fields), consider retrieving 10–20 items at a time.
  • If fetching lightweight data (e.g., only names and paths for generating a sitemap schema), you may retrieve up to 100 items at a time.

Avoid fetching all tenant data in a single request, as this can lead to inefficient performance, and your query might even be blocked by Crystallize.

Circle loading spinnerImage of a partial circle indicating &qoute;loading&qoute;.Fetching snippet...
People showing thumbs up

Need further help?

Join and ask our
slack community.

Join our slack community