Skip to main content

Search and Recommendation API reference and data model

Abstract

Where to find reference information for the Search and Recommendation API for Sitecore Search.

To help you work with the Search and Recommendation API, you can view the detailed data model and descriptions of the objects and keys.

The following is a sample data model of the API request:

{
  "context": {
    "ids": [
      "string"
    ],
    "locale": {
      "country": "us",
      "language": "en"
    },
    "page": {
      "uri": "string"
    },
    "user": {
      "uuid": "string"
    }
  },
  "entity": "string",
  "rfk_flags": [
    "+semsearch"
  ],
  "search": {
    "content": {
      "fields": [
        "name",
        "price"
      ]
    },
    "facet": {
      "all": true,
      "max": 10,
      "sort": {
        "name": "text",
        "order": "asc"
      },
      "types": [
        {
          "after": "facetid_123",
          "exclude": [
            "val1",
            "val2"
          ],
          "filter": {
            "type": "or",
            "values": [
              "facetid_123",
              "facetid_123"
            ]
          },
          "filtering_options": [
            "hard_filters",
            "other_facet_values"
          ],
          "keyphrase": "Sitecore",
          "max": 10,
          "min_count": 1,
          "name": "brands",
          "sort": {
            "name": "text",
            "order": "asc"
          }
        }
      ]
    },
    "filter": {
      "type": "string"
    },
    "group_by": "group_id",
    "limit": 10,
    "offset": 0,
    "personalization": {
      "algorithm": "hard_filters",
      "fields": [
        "brand",
        "color"
      ],
      "ids": [
        "id1",
        "id2"
      ]
    },
    "query": {
      "highlight": {
        "post_tag": "</em>",
        "pre_tag": "<em>"
      },
      "keyphrase": "Sitecore",
      "operator": "or",
      "relevance": [
        {
          "analyzer": "rfk_standard",
          "name": "color",
          "weight": 1
        }
      ]
    },
    "ranking": [
      {
        "name": "sales",
        "weight": 1
      }
    ],
    "related_questions": {
      "highlight": {
        "post_tag": "</em>",
        "pre_tag": "<em>"
      },
      "max": 10
    },
    "rule": {
      "behaviors": true,
      "blacklist": {
        "filter": {
          "type": "string"
        }
      },
      "boost": [
        {
          "filter": {
            "type": "string"
          },
          "slots": [
            1,
            5
          ]
        }
      ],
      "bury": {
        "filter": {
          "type": "string"
        }
      },
      "include": [
        {
          "filter": {
            "type": "string"
          },
          "slots": [
            1,
            5
          ]
        }
      ],
      "pin": [
        {
          "id": "id1",
          "slot": 1
        }
      ]
    },
    "sort": {
      "choices": true,
      "value": [
        {
          "name": "color",
          "order": "desc"
        }
      ]
    },
    "suggestion": [
      {
        "max": 2,
        "name": "my_suggester"
      }
    ],
    "swatch": {
      "fields": [
        "name",
        "price"
      ],
      "group_by": "group_id",
      "max": 10
    }
  },
  "sources": [
    "source1",
    "source2"
  ],
  "widget": {
    "rfkids": [
      "rfkid_7",
      "rfkid_6"
    ]
  }
}