Effective Document Deletion Strategies in Typesense
TLDR Adrian asked about deleting potentially non-existent documents. Pantelis suggested using IDs for document deletion or queries within delete function. Adrian decided to use query-based deletions.
Aug 08, 2023 (4 months ago)
Could not find a document with id:error and treating that as a non error case, or is there a better way to do so? Perhaps deleting by query would be a better approach
If it is not found then i am catching the error. The delete accepts idOrQuery. So if you have assigned an id before in each of your documents then typesense will find it and delete it. When i want to delete a set of documents i use a query inside delete, for instance:
delete('submitted:=true')which is going to find all the submitted documents in your schema and delete them
Indexed 3011 threads (79% resolved)
Deleting Documents from Typesense Cloud and Version Upgrade
Masahiro asked how to remove documents from Typesense. Kishore Nallan clarified it varies by version and suggested upgrading from 0.20 to 0.22. Masahiro agreed to test this.
Deleting and Creating Documents in Typesense
Priyank asked for help with deleting and creating documents in Typesense and found the problem to be an issue with their own code. Jason offered support.
Deleting All Documents in Typesense Collection
Vikas wanted to delete all documents in a typesense collection. Kishore Nallan suggested using a range filter on a numerical field to match and delete the entire dataset.