@texthill/textile
v0.3.0
Published
A store implementation to store the indexes for texthill in Textile ThreadsDB (IPFS)
Downloads
14
Maintainers
Readme
TextHill / Textile integration
A search engine that makes the documents in textile threads db searchable.
Using textile repository as a helper to work with the search model.
Look at this example below to get you started.
import { SearchModel, TextileStore } from '@texthill/textile';
const repo = new Repository<SearchModel>(searchCollectionName, db, threadId);
const th = new TextHill(new TextileStore(repo));
const feed = async () => {
await th.feedDoc(model._id, model);
const results = await th.search("feeding");
}
Or remove the document from the index.
const repo = new Repository<SearchModel>(searchCollectionName, db, threadId);
const th = new TextHill(new TextileStore(repo));
th.removeDoc(model._id).then(_ => console.log('succesfully removed'))