jaeyson / ex_typesense

Typesense client for Elixir with support for importing your Ecto schemas.
https://hexdocs.pm/ex_typesense
MIT License
30 stars 11 forks source link

Use id instead of foreign key to delete all documents in a collection #45

Closed jaeyson closed 3 months ago

jaeyson commented 3 months ago

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:

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.

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