Highlight
Highlight your search keywords in search results.
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.
Updated 27 days ago
Next
