0.3.0 • Published 4 years ago

@texthill/textile v0.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

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'))