We are a content company, and we produce articles where articles can be published immediately, or for a future date.
Our website handles this by simply looking at the publish_date and displaying content if today() > publish_date.
We’ve configured Algolia to index content once it’s published or scheduled.
We don’t want to set up a cron job to constantly watch for scheduled articles to go from scheduled to published… Instead, we’d like to offload this logic to Algolia or our InstantSearch.js presentation layer.
What’s the best approach here? I’m able to hide search results in the presentation templating layer (
display: none if today() < publish_date), but that screws with result counters (10 hits, when only 5 are displayed).
Does Algolia support querying the index like so? “
<query> AND today() > publish_date”
Any other suggestions?
Thanks so much!