Sorting

Just like the Sooqr overlay, the Search API uses the mySooqr settings for possible sorting methods. A sort method is a combination of a datafield and one or more field boosts, combined with a sort order (ascending or descending).

A sort method is identified by its unique ID. This ID can be fetched from the Sooqr API:

https://api.sooqr.com/v1/config/100506/1/sort-methods

This API call will return the available sort methods for the Sooqr instance:

{
   "items":[
      {
         "id":2683,
         "label":"Relevance",
         "sequence":1,
         "order":"desc"
      },
      {
         "id":2686,
         "label":"Price (low to high)",
         "sequence":2,
         "order":"asc"
      },
      {
         "id":2687,
         "label":"Price (high to low)",
         "sequence":3,
         "order":"desc"
      },
      {
         "id":2684,
         "label":"Title (a - z)",
         "sequence":4,
         "order":"asc"
      },
      {
         "id":2685,
         "label":"Title (z - a)",
         "sequence":5,
         "order":"desc"
      }
   ]
}

The sort parameter takes one id value. You can only use one sort method at a time. When no sort option is specified, the first option (with sequence 1) is used.

https://api.sooqr.com/v1/search/100506/1/?q=women&sort=2686