If anyone is dealing with the same situation, I ended up creating a
rake task that would find all the expired listings once a day, and
update the active column to false, and I can easily use that column in
my searches.

define_index do
    indexes title, description, city
    where "active = 't'"
end


On Dec 8, 11:10 am, Will Clark <[email protected]> wrote:
> I have a directory of listings each with an expires_on column. I'd
> like the search results to return anything that has an expires_on >
> Date.today OR expires_on IS NULL (for listings that have no expiration
> date).
>
> Is it best to add that in the define_index block (if so, with a where
> statement?), or as a :condition of the search itself?

--

You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.


Reply via email to