Hide products by datetime (rule?)

Im using Algolia Search and Discovery for Shopify. I’ve added a metafield to products named “unpublish_at”. How can I use an Algolia rule to exclude products from the index when that datetime has passed?
If rules cant help me, is there any other way I can solve it?