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

How to insert new document into the pre-built index? #335

Open
pursuemoon opened this issue Apr 18, 2024 · 1 comment
Open

How to insert new document into the pre-built index? #335

pursuemoon opened this issue Apr 18, 2024 · 1 comment

Comments

@pursuemoon
Copy link

If I have pre-built an index of data and a new document needs to be indexed, is there a way to insert the new document into the existing index so that it becomes a new index?

@jlscheerer
Copy link

I believe you can use the IndexUpdater in that case @pursuemoon.

from colbert import IndexUpdater
index_updater = IndexUpdater(config, searcher, checkpoint)
index_updater.add(new_document_collection)

If you want to persist the changes call index_updater.persist_to_disk()

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