Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a persistent index #1

Open
nevf opened this issue Nov 24, 2016 · 1 comment
Open

Using a persistent index #1

nevf opened this issue Nov 24, 2016 · 1 comment

Comments

@nevf
Copy link

nevf commented Nov 24, 2016

You mention:

Allows saving/loading the index to/from disk, but for small datasets you can feed the index on-the-fly.

however I can't see any documentation about this. I'd like to store the index in a database (MongoDB) and query that.

FYI I'm looking at and evaluating the various full-text search libraries available for Node.js and the Browser and have only just found thinker-fts and from reading the documentation is looks quite good.

It would be nice to see a better online demo though. Fuse.js is excellent in this regard, but you don't need to go quite that far.

@Hexagon
Copy link
Owner

Hexagon commented Nov 24, 2016

By feeding the index on-the-fly, i mean running thinker.feed(...) with the full dataset like in the first example of the readme.

As the "feeding" is quite fast, saving a pre-calculated index to/from disk is only necessary for large datasets (~ >1000 full text documents) where it starts taking seconds, or for huge datasets minutes.

thinker.feed([
    [1, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'],
    [2, 'Ipsum', 'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.']
]);

I think, you can run it one entry at a time too.

result.forEach( (row) => { thinker.feed([row]) } );

I will look into making a good online demo when i find some spare hours :)

All feedback is appreciated, keep it coming 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants