Using the id from document is much better than using foreign key for clearing up all documents in a collection.
Update:
To delete all documents in a collection, you can use a filter that matches all documents in your collection. For eg, if you have an int32 field called popularity in your documents, you can use filter_by=popularity:>0 to delete all documents.
https://github.com/jaeyson/ex_typesense/pull/33#pullrequestreview-2220240012
Using the id from document is much better than using foreign key for clearing up all documents in a collection.
Update:
Another discussion: https://threads.typesense.org/t/deleting-typesense-documents-with-specific-field-using-filter-by-/2J3912e
I'll open this issue if Typesense added a wildcard for filter_by in
id