HomeDev guideAPI ReferenceGraphQL
Dev guideUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Highlighting

Highlight your search keywords in search results.

πŸ‘

Beta

The Optimizely Graph .NET Client is in beta. Contact your Customer Success Manager for information.

To build a search query with highlighted snippets in Optimizely Graph, the Optimizely Graph .NET Client provides HightLightOptions for searchable fields.

query.Field(x=> x.SearchableField, HighLightOptions.Create().Enable(true).StartToken("<b>").EndToken("</b>"))
     .Filter(x=> x.SearchableField.Match("your_key_words"))

To enable highlighting, set the Enable method to true. The parameter must be boolean.

StartToken and EndToken wrap your matched keywords. The previous example wraps your matched keywords in the HTML tags <b> and </b> to make the text bold.