krisk / Fuse

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

The extended search operator = (exact match) is not working, every time I use it I get no results. #633

Closed jmdiazlr closed 2 years ago

jmdiazlr commented 2 years ago

Describe the bug

The exact match operator of extended search is not working, every time I use it I get no results.

Version

Latest to date.

Is this a regression?

Do not know.

🔬Minimal Reproduction

In any index, use a search expression including a exact match request like:

   fuse.search("=term1  term2 term3");

You won't get results but if you take out the equal sign , voyla, there are results including term1 and other terms.

Additional context

I followed the code, a thing the problem is in ExactMath.js, it compares item's full text === search term, but it should compare every token in item's text against search_term...

I do not know how to regenerate (compile) the project to test my previous finding.

In the mean time, I instructed my users to use the contains operator ('term), it works well.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days