LostKobrakai Posted March 4, 2016 Posted March 4, 2016 Has anyone here a recommendation on a simple fulltext search library in javascript? I've ~30 FAQ item that should be searchable, but somehow all the libraries I've tried are missing even fullword hits at times. Either they are to fancy and miss those basic hits or they are to simple and have a hard time with fuzzy search terms. Tried out libs: lunr.js fuzzy.js elasticlunr.js fuze.js fuzzyset.js 1
Soma Posted March 4, 2016 Posted March 4, 2016 I used quicksilver.js on the cheatsheet.processwire.com not sure that's what you're looking for. http://ejohn.org/blog/jquery-livesearch/ 1
LostKobrakai Posted March 5, 2016 Author Posted March 5, 2016 @Soma Thanks for the hint, this whole string scoring topic yielded a lot more options to test. Hopefully there's one, that matches what I need it to do. But to answer your question: These FAQ items are quite simple – an id, an sentence of a question and a short paragraph of an answer. And I need some way to get the most fitting or relevant item.
horst Posted March 5, 2016 Posted March 5, 2016 The famous jquery DataTables have a Dynamic search / filter inputfield embedded what do a great job. Not exactly what you are looking for, but maybe worth a look into the code. Maybe they use an embedded sub library for that?
LostKobrakai Posted March 5, 2016 Author Posted March 5, 2016 list.js looks good, but I need to search in multiple lists (the faqs are grouped).
dragan Posted March 5, 2016 Posted March 5, 2016 Multiple groups = separate PW pages? How about something like this, using mainly data-attributes? http://www.redotheweb.com/2013/05/15/client-side-full-text-search-in-css.html
LostKobrakai Posted March 5, 2016 Author Posted March 5, 2016 That's a nice hack to show what's possible with css, but it doesn't support any kind of fuzzy matching, which isn't optimal.
elabx Posted March 11, 2016 Posted March 11, 2016 Is this for your InputfieldChosenSelect module? I've been using it a lot and found myself wishing for fuzzy matching.
LostKobrakai Posted March 12, 2016 Author Posted March 12, 2016 It's not. The module does use the chosen library. I just wrote the wrapper to include it in processwire.
Recommended Posts