Skip to main content

Using semantic search

Abstract

Describes using the Search and Recommendation API for Sitecore Search to get search results that consider the semantic meaning of a keyphrase or keyword.

To use semantic search instead of keyword search, you add +semsearch to the rfk_flags array.

For the data model, see the Search and Recommendation API reference.

In this example, you want to use semantic search to show results for the key phrase identify customer needs.

The following code shows a sample request:

{
    "widget": {
        "items": [
            {
                "rfk_id": "rfkid_7",
                "entity": "content",
                "rfk_flags": [
                    "+semsearch"
                ],
                "search": {
                    "content": {},
                    "query": {
                        "keyphrase": "identify customer needs"
                    }
                }
            }
        ]
    },
    "context": {
        "locale": {
            "country": "us",
            "language": "en"
        },
        "user": {
            "uuid": "159871551-1g-i4-4x-1p-f5tdhddqwvywv7b9g2vy-1664852644904"
        }
    }
}