0.0.9 • Published 9 years ago

node-ft v0.0.9

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

Full-Text Search engine for NodeJS

Node-FT adds basic in-memory Full-Text search capabilities to Node. Supporting:

  • Document Indexing
  • Results Sorting
  • AND / OR Operations
  • Nested Expresions: First and (whole or world or (another word))

=======

Installation

npm install node-ft

NPM

======= Basic Usage

var nodeFT= require('node-ft');

var inx = nodeFT();

inx.index('1', "this is some text");
inx.index('2', "this is some more text");

var docs = inx.search("this");

Document storage

inx.index('1', "this is some text",
{ 
    value: 12,
    some: 'this is a doc' 
});

var docs = inx.search("this");

console.log(docs[0].doc.value);

Sort Results

var docs = inx.search("this", function(result) {
    return result.doc.sort;
});

Delete Document

inx.delete('2');

OR expressions

var docs = inx.search("this or that", function(result) {
    return result.doc.sort;
});

Nested Expressions

var docs = inx.search("this or (that and other)", function(result) {
    return result.doc.sort;
});

Clear Index

inx.clear();

Get Document Count

var docCount = inx.count();
0.0.9

9 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago