SortingRuleSearch resource (Data API 19.3)

Summary

Http Method Resource Description
POST /sites/{site_id}/sorting_rule_search

Searches for product sorting rules.

The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:

  • id - String
  • description - String
  • creation_date - date of creation

The output of the query can also be sorted. These are the list of sortable attributes:

  • id - String
  • description - String
  • creation_date - date of creation

This resource does not support expand options.

Search Product Sorting Rules

Searches for product sorting rules.

The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:

The output of the query can also be sorted. These are the list of sortable attributes:

This resource does not support expand options.

Url

POST https://hostname:port/dw/data/v19_3/sites/{site_id}/sorting_rule_search?rule_context={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

SearchRequest

Response Document

SortingRuleSearchResult

Path Parameters

Parameter Type Description Constraints
site_id String The id of the site. minLength=1

Query Parameters

Parameter Type Description Constraints
rule_context String the optional context in which the sorting rule should be looked up, either "site", "global", or "any" (default) strings=[<error>, <error>, <error>]

Sample

REQUEST:
POST /s/-/dw/data/v19_3/sites/SiteGenesis/sorting_rule_search?context=site HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Accept: application/json

{
    "query" : {
        "text_query": {
            "field": ["id", "description"],
            "search_phrase": "price"
        }
    },
    "select" : "(**)"
}

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8

{
   "_v" : "19.3",
   "_type" : "product_sorting_rule_search_result",
   "count" : 2,
   "hits" : 
   [
      
      {
         "_type" : "product_sorting_rule",
         "description" : "Sorts by price descending",
         "id" : "price-high-to-low",
         "context" : "site",
         "product_sorting_rule_steps" : 
         [
            
            {
               "_type" : "product_sorting_rule_step",
               "direction" : "Descending",
               "is_system" : false,
               "position" : 0,
               "text_relevance_included" : false,
               "type_id" : "price"
            }
         ],
         "site" : "SiteGenesis"
      },
      
      {
         "_type" : "product_sorting_rule",
         "description" : "Sorts by price ascending",
         "id" : "price-low-to-high",
         "context" : "site",
         "product_sorting_rule_steps" :
         [
            
            {
               "_type" : "product_sorting_rule_step",
               "direction" : "Ascending",
               "is_system" : false,
               "position" : 0,
               "text_relevance_included" : false,
               "type_id" : "price"
            }
         ],
         "site" : "SiteGenesis"
      }
   ],
   "query" : 
   {
      "text_query" : 
      {
         "_type" : "text_query",
         "fields" : 
         [
            "id",
            "description"
         ],
         "search_phrase" : "price"
      }
   },
   "select" : "(**)",
   "start" : 0,
   "total" : 2
}