I'd do this in two steps:
- query for existing documents that match the category using a value filter.
- issue a delete request referencing the IDs from the previous step's results.
You could also take an approach where each category goes into its own engine, and you you could delete the whole engine and re-create from scratch each time. But this might be overkill for your use case.