IndexSegment.js
A JS in memory search index.
Installation
$ npm install index-segment
Usage
//// Basic usage usages the built in tokenizer// which is pretty trivial and splits strings on// non alpha numeric characters.//var IndexSegment = ; // create your indexvar index = ; // put(docText, docId)index;//> 2 index;//> 3 index;//> [2] index;//> [1, 2]
Providing your own tokenizer.
The tokenizer is used during put
and search
methods.
var index = myTokenizer;
Development
Clone it :)
I'm using es6->es5 via babel, and polyfilling in Set
and Map
.
Run gulp
for the es5 translation.
npm test
for running the tests.
License
MIT
Author
Stan Rozenraukh