What would be the best approach to have Thinking Sphinx only index records where Today's date is less than or equal to the record's "expires_at" field?
Thanks in advance.
What would be the best approach to have Thinking Sphinx only index records where Today's date is less than or equal to the record's "expires_at" field?
Thanks in advance.
Hi Adam
The easiest approach is adding the following statement to your define_index block:
where "expired_at >= NOW()"
That's the MySQL version, anyway. PostgreSQL will be pretty similar:
where "expired_at >= current_timestamp"
Although, I'm no PostgreSQL expert, but hopefully that's close enough to what's needed.
Cheers