3.2.2 • Published 8 years ago

pure-fts v3.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Pure Full Text Search

Fast, compact full text search in pure javascript to support npm-kludge-search.

Usage

Building an Index

var Purefts = require('pure-fts');
var p = new Purefts();

p.add({ name: 'foo', description: 'a foo thing' });
p.add({ name: 'bar', description: 'a bar thing' });

p.freeze('index');

Searching an Index

var Purefts = require('pure-fts');

Purefts.thaw('index', function (err, p) {

  p.get('foo', cb);      # cb(err, data) 

  p.find({ name: 'foo'}, cb, done)
                       # returns { name: 'foo', description: 'a foo thing' }

  p.search('thing', cb, done);
                       # returns [ 'foo', 'bar' ]
})

When there are two callbacks cb and done, cb is called once with each matching record, and done is called after the search is complete. When there is only one callback (for get) it is called with the matching record or NULL if missing.

To support the needs of npm-kludge-search, this module assumes that name is the unique object key. The contents of the fields url, keywords, name and description will be added to the full text search index, in addition to the name field of the objects in the maintainers array.

Any of these fields are allowed to be missing.

It would make sense to abstract this into a set of paths, if this module were going to be useful for general purpose fts indexing.

TODO

fts doesn't work right yet

index on keyword or author does not work

3.2.2

8 years ago

3.2.1

9 years ago

3.2.0

9 years ago

3.1.0

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

2.1.2

9 years ago

2.1.1

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.1.2

9 years ago

1.0.0

9 years ago