Skip to content

Error when using InMemoryDocumentStore() #1090

@raghav-menon

Description

@raghav-menon

I had installed haystack and was trying to use inMemoryDocumentStore(). After initializing the document store, when I try to index it I receive the following error


ValueError Traceback (most recent call last)
in ()
----> 1 document_store.write_documents(dicts)

/usr/local/lib/python3.7/dist-packages/haystack/document_store/memory.py in write_documents(self, documents, index)
84 if document.id in self.indexes[index]:
85 # TODO Make error type consistent across document stores and add user options to deal with duplicate documents (ignore, overwrite, fail)
---> 86 raise ValueError(f"Duplicate Documents: write_documents() failed - Document with id '{document.id} already exists in index '{index}'")
87 self.indexes[index][document.id] = document
88

ValueError: Duplicate Documents: write_documents() failed - Document with id '4cdbad5973235417ea3e71769dc9c9ae already exists in index 'document'


I had tried this previously (about a month back) it worked perfectly well. Not sure why this is arising. Would be grateful if you could point me in the right direction.

Thanks

Raghav

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions