Package Exports
- thinker-fts
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (thinker-fts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
thinker
Fast and extendible Node.js/Javascript fulltext search engine.
Features
- Highly optimized, will give a ranked resultset within 20 ms on a 5000 (average wikipedia sized) document dataset.
- In-memory operation
- Very few external dependencies
- Natural language search
- Partial matching
- Expression correction
- Weighted ranker (configurable weights for each field, all-expression-match-factor, partial vs exact factor etc.)
- Field preprocessors
- HTML-Stripper
- Word preprocessors
- Swedish stemmer with stemmer stopwords
- Stopwords
- Wordforms
- Stripper for multiple characters
- Allows saving/loading the index to/from disk, it's a lot faster to load a previously saved index than generating it on the fly.
Installation
npm install thinker-ftsIntroduction
var Thinker = require('./lib');
var thinker = Thinker(),
ranker = Thinker.rankers.standard();
// Connect standard ranker
thinker.setRanker(ranker);
// Feed thinker with documents of format [id, textfield, textfield, ...]
thinker.feed([
[1, "Title", "Text"],
[2, "Title2", "Texts"]
]);
// Search for text
var result = thinker.find("Text");
// Show result
console.log(result);
/*
{
results: {
expressions: [ ... ]
documents: [... ]
},
totalFindTime: 0,
totalRankTime: 0
}
*/Credits
Licence
Licensed under the MIT License