algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.66k stars 514 forks source link

Bug: incorrect highlight with full-width characters #5444

Closed shigma closed 1 year ago

shigma commented 1 year ago

🐛 Current behavior

image

I searched with the 2-character word "测试", but got 5 characters highlighted.

🔍 Steps to reproduce

  1. go to the page below
  2. search "测试"
  3. see the incorrect highlight

Live reproduction

https://koishi.chat

💭 Expected behavior

Only "测试" should be hightlighted.

Package version

vue-instantsearch 4.7.2

Operating system

not relavent

Browser

not relavent

Code of Conduct

Haroenv commented 1 year ago

You've marked this issue as closed, did you find out what was causing it? I believe it would be the actual engine returning those highlights, if they happen consistently. Possibly synonyms are also involved?

shigma commented 1 year ago

Yes. It seems an issue from meilisearch. Their matchesInfo contains byte length instead of character length. So I'll be tracking this issue on their side.