krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.76k stars 753 forks source link

How to return actual characters matched #719

Closed nikitavoloboev closed 1 year ago

nikitavoloboev commented 1 year ago

Description

I want to build this feature:

image

Essentially I want to highlight the character matches and I wanted to get them from Fuse.js library itself as it does the fuzzy search matching.

Describe the solution you'd like

I read docs and I can't find a way to actually return me the matches. The .search() method just returns the filtered items from the array of the index.

Is this use case possible to do with this library?

nikitavoloboev commented 1 year ago

Ok its includeMatches, will try use it.