krisk / Fuse

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

Question, or bug on live demo page #732

Closed TDola closed 10 months ago

TDola commented 1 year ago

Is there an existing issue for this?

Your question

On the demo page https://www.fusejs.io/demo.html

If you search for symbols

The results make no sense.

[
  {
    "item": {
      "title": "The Lost Symbol",
      "author": {
        "firstName": "Dan",
        "lastName": "Brown"
      }
    },
    "refIndex": 10
  },
  {
    "item": {
      "title": "Monster 1959",
      "author": {
        "firstName": "David",
        "lastName": "Maine"
      }
    },
    "refIndex": 22
  }
]

There is nothing matching for David or Monster. At best monster has 3 matching letters in a totally different order.

Can someone explain why Monster 1959 is a result for symbols but not for symbol?

msj121 commented 1 year ago

As a newb: perhaps because symbols is a closer match: "__m_o_s" is somewhat close to "mons" in monster. Whereas symbol does not have that final "s" in position. You can lower "threshold" to 0.4 to limit more results to higher matches.

github-actions[bot] commented 11 months ago

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