Ability to exclude documents matching a certain criteria from index
We don't do physical deletion of documents, but a logical one, flagging them by setting a value for a deleted_at
field.
We would like an option to exclude documents where that field exists and is not null from the index, because they will never be returned and are only consuming space of the index.
Currently we use a mustNot
condition to exclude them, but of course they are still being indexed.
The ideal would be to be able to define the exclusion criteria in the index definition.
1
vote
![](https://secure.gravatar.com/avatar/d03ef7776e8abbe0d8cb82a67ddfd58c?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)