Mark Tucker
Mark Tucker

Reputation: 434

Algolia Remove _highlightResult from search results

In the response from a search call, I get back a hits array and each item in the array includes a _highlightResult property. Is there any way to prevent that property from being returned in the search results?

Upvotes: 6

Views: 2042

Answers (1)

simon.ro
simon.ro

Reputation: 3312

There's an option attributesToHighlight.

You can use it as an index setting or specify it per search request in the params. By default, all searchable attributes will be highlighted, but if you explicitly set it to an empty array attributesToHighlight: [], none will be highlighted.

Please see https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/?language=javascript

Upvotes: 15

Related Questions