Forum: Ruby on Rails Thinking Sphinx

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Raghu 2. (Guest)
on 2009-05-14 18:28
Search criteria
1.Searching with the combination of the "AND" and "OR" conditions for
four to five fields of the table.
  -Added the indexes for the search fields.
  Ex1. Order.search(:conditions=>["store_id=16 and
(store_order_id='23432' or store_customer_id='23432')" ])
    -This query is returning the empty result set.

  Ex2.
Order.search(:conditions=>{:store_id=>16,:store_order_id=>"23432",:store_customer_id=>"23432"})
    -This query works perfectly,but this is a combination of the "AND"
condition.

Trying to find a solution to search on the multiple fields combined with
"AND" and "OR" conditions.

Regards,
Raghu
This topic is locked and can not be replied to.