searchlogic icon indicating copy to clipboard operation
searchlogic copied to clipboard

OR conditions with Search class

Open davidsevcik opened this issue 16 years ago • 4 comments

Could be possible to add OR support even to Search class. I would like do this Book.search(:title_or_description_like => 'ruby') or in chain s = Book.search s.title_or_description_like('ruby')

Now it produce only s.conditions => {:title_or_description_like => false}

Thanks for wonderful work.

davidsevcik avatar Sep 16 '09 22:09 davidsevcik

is this going to be worked on, I just ran into this. A large part of using search logic is the search method, but you currently cant use or statements like: User.search(:gpa_lte_or_null => 4) It just ignores all the conditions.

jtoy avatar Sep 30 '09 17:09 jtoy

noticed the same issue. a bit annoying.

theworkinggroup avatar Oct 27 '09 20:10 theworkinggroup

would be very helpful if the search object supports OR chaining as well.

xijo avatar Nov 03 '09 22:11 xijo

I have an issues somewhat like this, Trying to search an association if it exists.

Place.{:title, :brand_id} Brand.{:title}

Place.title_or_brand_title_like_any(q)

only searches places that are associated with a brand, fails to return places without a association.

kylewelsby avatar May 06 '10 16:05 kylewelsby