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

Index updating #13

Open
gpothier opened this issue Mar 4, 2013 · 3 comments
Open

Index updating #13

gpothier opened this issue Mar 4, 2013 · 3 comments

Comments

@gpothier
Copy link

gpothier commented Mar 4, 2013

Is it possible to update the indexes (ie. inject more items) after the initialization? How would one do that?

@terrycojones
Copy link
Contributor

If you save the result of calling open, you can then add new docs using injectDocument. E.g., pseudo-code

var engine = new fullproof.BooleanEngine().open(.....);
engine.injectDocument('text...', key, callback);

Don't consider this an "official" answer, but it's what I'm doing :-)

@reyesr
Copy link
Owner

reyesr commented Mar 5, 2013

Sounds legit ^^

Terry's answer is correct. engine.injectDocument() injects a document into all the indexes used by the engine, using the appropriate analyzer for each index.

The initialization process is just an optional, yet handy way to initialize an engine, as it transactionnally indexes all the documents: when using multiple indexes, if the initialization process is interrupted by the user (ie.closing the browser's window), the next time the user opens the application, it will not start over, but continue on the indexes that were not complete (each index is done sequentially). Of course, it's always possible, at any time after the engine is opened, to inject new documents.

@gpothier
Copy link
Author

gpothier commented Mar 6, 2013

Thanks a lot!

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

3 participants