#community-help

Resolving Document Export & Batch Deletion Issues

TLDR Dui had trouble exporting a document and wanted batch deletion assistance. Kishore Nallan fixed the export issue, upgraded their cluster manually and suggested using delete by query.

Powered by Struct AI
+11
white_check_mark1
22
20mo
Solved
Join the chat
Jan 20, 2022 (20 months ago)
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:10 AM
Can you also tell me your cluster id?
Dui
Photo of md5-a9d19b78fd4b11dda3ca3162c25054a9
Dui
09:10 AM
Yeah sure: h528vmptn1g0crwbp
09:11
Dui
09:11 AM
But really, I'm just trying to export one single document
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:11 AM
Okay, one second, let me look.
Dui
Photo of md5-a9d19b78fd4b11dda3ca3162c25054a9
Dui
09:12 AM
The JS-client, btw!
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:18 AM
Can you try again now? The import somehow wasn't going through, I have no idea why. Let's try again to see if it is happening again.
09:18
Kishore Nallan
09:18 AM
Btw, this version does not contain the emplace action. That's on a RC build.
Dui
Photo of md5-a9d19b78fd4b11dda3ca3162c25054a9
Dui
09:20 AM
Ah right, could you update us to that rc version?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:20 AM
Ok, hold on.
09:28
Kishore Nallan
09:28 AM
Ok done.
09:29
Kishore Nallan
09:29 AM
We have a different scheduled process for customer upgrade requests that queues up upgrades. For now, to unblock you, I have upgraded your cluster manually, but will schedule for a former upgrade later on. So the UI will still reflect 0.22.1.
09:30
Kishore Nallan
09:30 AM
You can hit the /debug end-point to confirm that version: it will be 0.23.rc20
Dui
Photo of md5-a9d19b78fd4b11dda3ca3162c25054a9
Dui
09:32 AM
Ok, great! Thank you 🙂
+11
09:40
Dui
09:40 AM
Working now 🙂 Btw, is there a way to batch delete?
09:40
Dui
09:40 AM
documents, that is
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:41 AM
You can use delete by query : https://typesense.org/docs/0.22.1/api/documents.html#delete-by-query

Send a filter_by that contains a condition that can match all records.
09:41
Kishore Nallan
09:41 AM
We have a todo item to support a wildcard * (delete all) operation.
09:43
Kishore Nallan
09:43 AM
If you don't have such a field that can match all records, then you have to drop the collection and re-create it.
Dui
Photo of md5-a9d19b78fd4b11dda3ca3162c25054a9
Dui
10:13 AM
Ok, I wa more thinking of something like the batch import, where I would pass in an array of documents to import and define a batch size.

In our case, we might have a thousand events coming in from our kinesis stream, where 500 might be emplace, and 500 delete. I will then group them by their different actions and perform them by batch.

What would be the best way of doing something like that for delete, you think?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:14 AM
Yeah you can do filter_by=id: [id1, id2, id3]
Dui
Photo of md5-a9d19b78fd4b11dda3ca3162c25054a9
Dui
10:15 AM
Badabing badaboom! Thanks
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:15 AM
I will update the docs to add this use case.
white_check_mark1