algolia / vue-instantsearch

👀 Algolia components for building search UIs with Vue.js
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/vue
MIT License
853 stars 157 forks source link

Highlighting doesn't work for nested Objects #1063

Closed soolace closed 3 years ago

soolace commented 3 years ago

Bug 🐞

What is the current behavior?

Highlighting is not working for nested objects. But the documentation of algolia says, it should be possible:

https://www.algolia.com/doc/api-reference/widgets/highlight/vue/

The highlightResult looks like this: (the nested object is reading as a String and replaces the " with & quot ;.

image

Btw. Searching works fine, its just the highlighting. It only works, when I flat the JSON.

What is the expected behavior?

I expected, that it works like in the documentation described.

What is the version you are using?

"vue-instantsearch": "^4.0.0"

Always try the latest one before opening an issue.

Probably it's not possible yet or I miss something. If it's necessary to see a Demo, I will create a Codepen. But the Code is similar to the Basic-Demo. Thank you

tkrugg commented 3 years ago

hi @soolace that should work on nested attributes too. I just tried it here: https://codesandbox.io/s/spring-hill-rxk7h Can you make sure you've added your nested attribute to highlighted results under Configuration > highlight > Attributes to highlight?

This should solve your problem.

I'll close for now. If it's not solved, please reachout at our support, so we can take a closer look at your account configuration.

soolace commented 3 years ago

Thank you very much @tkrugg, this should solve my Problem.