Displaying 1 result from an estimated 1 matches for "search_end_date".
2006 Nov 23
2
Conditional queries
...ally doing the
query so these are not excluded.
Perhaps showing some code will help explain better;
search_controller.rb
@results = Page.multi_search(
"active:(true)
*:(#{params[:s]})
search_start_date:( <= #{Time.now.strftime("%Y%m%d")} )
search_end_date:( >= #{Time.now.strftime("%Y%m%d")} )",
[],
{:offset => @offset, :limit => @limit}
)
Page.rb
def search_start_date
self.start_at.strftime("%Y%m%d") if self.start_at
end
def search_end_date
self.end_at.strftime("%Y%m%d&quo...