0.3.6 • Published 4 years ago

indexedfts v0.3.6

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

IndexedFTS

Full-Text Search engine for web browser.

NPM

Build Status Coverage Status license document

install

HTML

<script src="https://unpkg.com/indexedfts"></script>

Node

$ npm install indexedfts

ES6

import IndexedFTS from 'indexedfts';

common js

const IndexedFTS = require('indexedfts').IndexedFTS;

example

// make database
const db = IndexedFTS('database-name', 1, {
	userid: 'primary',                     // primary key will indexed but can not full-text search
	name: {unique: true, fulltext: true},  // unique index and can full-text search
	description: 'fulltext',               // full-text search
});


db.open()
	.then(() => {
		db.put({
			userid: 1,
			name: 'hello',
			description: 'this is test\n',
		}, {
			userid: 20,
			name: 'world',
			description: 'check check\nhello hello world!',
		});
	})

	.then(() => db.search(['name', 'description'], 'hel').lower('userid', 5))
	.then(result => {
		console.log(result.length);   // output: 1
		console.log(result[0].name);  // output: hello
	})
0.3.6

4 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago