Skip to main content
More in Learn

Input Arguments

The input arguments that can be used while querying the Search API are discussed in this section.

Search Arguments

Any query made using the Search API requires arguments. These include: language, after, before, first, orderBy and filter.

Language

In Crystallize, you can translate any of the items (documents, folders or products). Using the language argument, you can search for items in a particular language. For example, the query below searches for items that are in Spanish.

After

The after argument in the query is the cursor and is used when you want to paginate search results. The argument takes in a string value which is a base64 encoded version of the offset. In the following query, we are getting the items "after" the second item by giving the argument a value of "MQ==" (base64 encoded version of 1).

You can use the cursor field to get the cursor value for each item. To learn more about this argument as well as pagination, head to the pagination section.

Before

This argument does the opposite of what the after argument does. It gets the values that are before the specified offset value provided to the argument. In the query below, we are getting all the items that exist "before" the third item by giving the argument a value of "MQ==" (base64 encoded version of 2).

First

This argument allows you to fetch only the amount of items you specify. Let's say you only want to grab the first three items from the search results. this is how you would do it:

orderBy

To order the search results, you can use the orderBy argument. You will need to specify the field name and the order direction within this argument. In the following query, we are ordering by name and the direction is set to ascending.

Filter

The search results can be filtered using the filter argument. The items can be filtered using any of the following: search term, type, variants, etc. The query below filters items using the search term 'plant'.

People showing thumbs up

Need further assistance?

Ask the Crystallize team or other enthusiasts in our slack community.

Join our slack community