Sometimes you may have a use case where you want to dynamically filter certain records out of your search results.
For example, if you have an online store selling music and want to not show any songs that the user has purchased previously in the search results.
It is not scalable to index which users have purchased a particular song in the record in question, because as you get more users your record size would soon grow far too large.
The alternative approach can be to add a filter, which filters out each product you do not want to show for the user in question (e.g. NOT ObjectID:14353 AND NOT ObjectID:43353). However, if you have users that have purchased lots of songs (you can only have up to 1000 filters in a single search) then you will be unable to add all the filters you need to hide these results. In this case you have a few options:
Option 1 - Find groups of products and add filters for them instead
This option would require you to analyze the distribution of the dynamic group in order to find patterns. For example, if you often sell all songs in an album together then instead of adding a filter for each song in the album, you would add a filter for the whole album or even an entire discography. This can dramatically reduce the number of filters you need to add.
Option 2 - Identify the "whales" and index these ones only
The second option (which indeed can be used in tandem with the first) is to identify the users (whales) who have a large number of filters they need to apply, and then add a filter to the products you do not want to show to just them as an attribute on those products. As long as the number of whales you are filtering out items for is fairly low (You can compress the array with allowCompressionOfIntegerArray to handle up to 10,000 such users) then the impact on the record size of your records would be relatively small. Please note that you will also need to make sure that you do not exceed your record size limit this way.