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.
It supports multi-field search, stop-word removal, tf-idf - but no Okapi BM25 alas.
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/
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/contributo...