Indexing error

Things were working ok, but now I’m getting the following error:
ERROR:root:REST upload failed with code 409, reason Conflict, text {“httpCode”:409,“internalCode”:409,“details”:“Indexing doesn\u0027t support updating documents. The new request does not match the previous request for document id \u0027file1\u0027.”,“status”:{“code_”:409,“statusDetail_”:“Indexing doesn\u0027t support updating documents. The new request does not match the previous request for document id \u0027file1\u0027.”,“memoizedIsInitialized”:1,“unknownFields”:{“fields”:{}},“memoizedSize”:-1,“memoizedHashCode”:0}}

Hi Nabil,

Vectara API at the moment doesn’t support updating an existing document. You will have to call delete first to delete the existing document. After that, you can index the document again with updated contents.

Please note that a document is uniquely identified by it’s document_id

See here for details: Deleting Documents | Vectara Docs

Here is a similar post addressing this question: What is the recommended way to update a document?

I changed the document_id for the same file and I still get the same error.

Hi Nabil,

It looks like you are using file_upload method as we discussed here earlier (Upload_file error - #2 by aamir)

If that is the case, then the document id is generated automatically by Vectara, and is equivalent to the filename. So, you just need to rename your file to something else and try the upload again via API.

Thanks, Amir. That worked. Just to be clear using the upload api does not index the corpus. right?

Both file_upload and upload methods index the data to a corpus.

The corpus to which data is indexed is provided as corpus_id