Today I’m happy to release Planbox‘s first contribution to the open source community. It is a small Javascript search engine called JSSE (pronounced Jesse). It is a single Javascript file you can use to index strings and perform rapid lookup. JSSE performs partial matching (a.k.a trailing wildcard query) for all or any search terms.
We have developed JSSE to increase performance of auto-completes, client-side. To see a demo, go here.
To make use of it, include it in your HTML header. Then create an instance like this:
se = new Jsse();
Index a text found in a document like this:
se.add('Instant search in Google is awesome!', 'quote');
se.add('It will work find after you install that patch.', 'instruction');
se.add('I bought a red car.', 'mid-life crisis');
Find a match like this:
se.match('inst');
Returns:
['quote', 'instruction']
JSSE is dynamic. You can remove what you’ve previously added.
se.remove('Instant search in Google is awesome!', 'quote');
JSSE is hosted here: www.planbox.com/code
If you find bugs or would like to suggest enhancements, please post them here.