Package Exports
- indexedfts
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 (indexedfts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
IndexedFTS
Full-Text Search engine for web browser.
install
HTML
<script src="https://unpkg.com/indexedfts"></script>Node
$ npm install indexedftsES6
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
})