mattyork / fuzzy

Filters a list based on a fuzzy string search
MIT License
831 stars 86 forks source link

Exact substring match > fuzzy match #40

Open ccorcos opened 7 years ago

ccorcos commented 7 years ago

Similar to https://github.com/mattyork/fuzzy/pull/15, I'm having an issue where "div" is an exact substring match but fuzzy matches are ranked above.

ccorcos commented 7 years ago
[
  {
    "string": "Add Google Drive",
    "score": 5,
    "index": 9,
    "original": {
      "name": "Add Google Drive",
    }
  },
  {
    "string": "Add Divider",
    "score": 5,
    "index": 13,
    "original": {
      "name": "Add Divider",
    }
  },
  {
    "string": "Add Invision",
    "score": 3,
    "index": 12,
    "original": {
      "name": "Add Invision",
    }
  }
]
ccorcos commented 7 years ago

oh interesting:

image

xoorath commented 5 years ago

yeah, I'm having trouble with this too.

I have an item that has my search term exactly 3-4 times, and another item that's has something close to my search term a few hundred times, and the exact match isn't preferred.

Edit: fuse.js seems to be dramatically better at this time. Search results with fuzzy took about 2 seconds, happens in a few milliseconds with better results using fuse.