Whoosh deletes existing fields when I run writer.update_document

16 Views Asked by At

I am adding a functionality to update a few fields in a document but everytime I update a field , whoosh deletes all the other fields in the document and only keeps the updates field. Here is my code snippet for reference

        var = eval(f"u'{archive_number}'")
        writer = self.ix.writer()
        writer.update_document(Archive_No=var, Director= text)
        writer.commit()

the other fields in this document where ID is Archive_No are actor , date etc. I want to retain those when I change/update the Director

0

There are 0 best solutions below