brianreavis / sifter.js

A library for textually searching arrays and hashes of objects by property (or multiple properties). Designed specifically for autocomplete.
1.1k stars 125 forks source link

Higher score for adjacent matched tokens #12

Open kinergy opened 10 years ago

kinergy commented 10 years ago

It would be great if "grade 2" matched "grade 2 smith room 311" higher than "grade 4 roberts room 214". Same for "room 2" should show the second result scored higher than the first.

Any thoughts on how best to approach this? If you have any ideas let me know, I'd be happy to submit the enhancements back in as a PR.