Per standard, Clerk.io sorts results in Search based on what most customers will be likely to buy, which is a great conversion booster.

However, the Search API has a built-in function that allows you to choose a specific attribute to sort by, which will still list products based on popularity, but at the same time sort them based on the attribute you select. 

Here is an example:

<span class="clerk"
      data-template="@search-page"
      data-query="running shoes"
      data-orderby="price"
      data-order="asc">
</span>

data-orderby lets you choose the attribute to filter by. Any attributes sent to Clerk.io can be used for this.

data-order can be either asc or desc for ascending and descending order.

The sorting can also be used in direct API calls:

http://api.clerk.io/v2/search/search?key=h1j24hfkafn2 nfl&query=running+shoes&limit=30&orderby=price&order=asc

Did this answer your question?