3 ms·
There's a pretty neat little project called 'lunr.js' which can provide a fairly fully-featured JavaScript search engine for use in the browser. It supports mu
by jka 11y ago
There's a pretty neat little project called 'lunr.js' which can provide a fairly fully-featured JavaScript search engine for use in the browser.
It supports multi-field search, stop-word removal, tf-idf - but no Okapi BM25 alas.
http://lunrjs.com/ http://lunrjs.com/
- azdle 11y agoTheres also http://elasticlunr.com/ http://elasticlunr.com/, I'm not sure what algorithm it uses, but the site says "Elasticlunr.js use quite the same scoring mechanism as Elasticsearch, and also this scoring mechanism is used by lucene.", so maybe? I can't say I know that much about this topic... I actually just used that library in creating a search for the docs site where I work and I have to say it works really well, it's a fully static site (hosted on github pages) and all the search is done in the browser based on an json "index" file that I generate along side the rest of the site. http://docs.exosite.com/ http://docs.exosite.com/
- olivernn 11y agoI'm fairly sure elastic lunr is a fork of lunr, I still seem to have the most commits even! [1] I'll have to take a look and see what @weixsong added, perhaps there are some changes that I can merge upstream. [1] https://github.com/weixsong/elasticlunr.js/graphs/contributors https://github.com/weixsong/elasticlunr.js/graphs/contributo...
- olivernn 11y agoThe last time this article was on HN I took a look at adding Okapi BM25 to lunr, from what I remember the changes don't seem to huge, its just a matter of getting the time to sit down and implement it!