I need to filter search results on the bases of 'OR' condition.I have
indexed Event model like :
Event--has many--EventUsers
define_index do
indexes event.summary
has is_private, created_by
has event_users(:id), :as => :event_ids
has event_users.user_id, :as => :event_user_id
has event_users.status, :as => :event_user_status
end
Now, I need to search somthing like
Event.search "something"
with following conditions
:conditions => ['(events.starts_at >= ? and events.starts_at <= ?)
AND ((events.is_private = 0 OR (events_users.user_id = ? AND
events_users.status = ?)) or (events.created_by = ?))"]
I tried it with :condtions => {} and :with => {} but both generates
the query with 'AND'.
what is the way to implement above conditions?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---