@texthill/textile

A store implementation to store the indexes for texthill in Textile ThreadsDB (IPFS)

Usage no npm install needed!

<script type="module">
  import texthillTextile from 'https://cdn.skypack.dev/@texthill/textile';
</script>

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