Bold matched searched term

How can I apply a strong tag to the matched search term in the snippet of the search results?

Hi @web6,

Thanks for your question!

I believe what you are looking for is the ‘highlightPreTag’ and the ‘highlightPostTag’ API parameters.

These parameters allow you to change the default HTML tags used before and after the highlighted parts in all highlight and snippet results.

Let us know how this works for you or if I’ve misunderstood your question!

Hi Cindy,

yes, that was helpful but now I seem to be having a different problem. So I have the “attributesToHighlight” setting enabled on the index and the “highlightPreTag/highlightPostTag” set to the strong tag for the content but it never inserts the tag in the displayed response, it just shows text normally.

Hi @web6,

Can you post a snippet of your code?