Find answers from the community

Updated 3 months ago

Refreshing the Index Results in a Python

Refreshing the Index Results in a Python Error

I am adhering to the instructions provided here: https://docs.llamaindex.ai/en/latest/module_guides/indexing/document_management.html#refresh

Plain Text
index = VectorStoreIndex.from_vector_store(vector_store=vector_store, service_context=service_context)
refreshed_docs = index.refresh_ref_docs(
    documents,
    update_kwargs={"delete_kwargs": {
        "delete_from_docstore": True
    }}
)


Error: ERROR - Unexpected err=TypeError("delete_ref_doc() got multiple values for keyword argument 'delete_from_docstore'"), type(err)=<class 'TypeError'>

I am using the latest version of LlamaIndex. Can anyone please help?
m
S
L
7 comments
can i see where you are defining your documents and index
sure

Plain Text
loader = JsonDataReader()
        documents = loader.load_data(source_data)


That's documents.

Plain Text
index = VectorStoreIndex.from_vector_store(vector_store=vector_store, service_context=service_context)


I am using Qdrant as the vector store
No need to pass the update kwargs it seems πŸ€”
@Logan M got it, thanks! So looks like it'll do a delete_from_docstore even without the kwargs, right?
Seems like it!
That would be the only way to do a proper upsert
Add a reply
Sign up and join the conversation on Discord