Find answers from the community

Updated last year

Hi, do I have to rebuild my index every

Hi, do I have to rebuild my index every time I make changes to the collection like adding a new document? what is the fastest way of doing this?
W
g
4 comments
No, you can insert new documents on existing index.

Plain Text
documents = SimpleDirectoryReader(DOCUMENTS_FOLDER, filename_as_id=True).load_data()

# add new docs in the existing index
for doc in documents:
  index.insert(doc)
I see, thanks bro
does insert cause duplication if it is fed with a file that was already ingestion before?
Yes, if you have some documents that had some updated content to it. You can simply opt for updating that particular document in the index.

For ref: https://docs.llamaindex.ai/en/stable/core_modules/data_modules/index/document_management.html#update
Add a reply
Sign up and join the conversation on Discord