Deleting All Documents in Typesense Collection
TLDR 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.
Powered by Struct AI
3
30mo
Solved
Jun 01, 2021 (30 months ago)
Vikas
Vikas
08:49 AMHello, started using typesense for an internal service and have been loving it. API's are great and easy to use.
I have hit one hurdle where I want to delete all documents for a collection. I know we can delete the collection itself but was checking if there is a way to delete all documents.
I have seen delete by filter_by api as well, but I cannot run something like name "not equal"(name: !="blah") to match all documents and delete them. Any pointers?
I have hit one hurdle where I want to delete all documents for a collection. I know we can delete the collection itself but was checking if there is a way to delete all documents.
I have seen delete by filter_by api as well, but I cannot run something like name "not equal"(name: !="blah") to match all documents and delete them. Any pointers?
Kishore Nallan
Kishore Nallan
09:54 AM Vikas We don't have a truncate collection end-point. However, you can achieve that with delete by filter API by doing a range filter on a numerical field with a value that matches the whole dataset. E.g.
points: >= 0
Vikas
Vikas
11:00 AMthanks Kishore Nallan I had that as a backup plan.
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 2779 threads (79% resolved)
Similar Threads
Deleting All Documents in Typesense Collection on Dashboard
Stephano asked how to delete all documents in a collection. Jason suggested using delete by query with a numerical field until the feature is officially added.
4
29mo
Solved
Deleting All Documents with Filter_by
Mischa wants to delete all documents using `id:*` filter but encounters issues. Jason suggests a workaround and advises creating a GitHub issue for the desired feature.
6
4mo
Effective Document Deletion Strategies in Typesense
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.
7
1mo
Solved