#32 ✓resolved
atmorell

input1 AND input3 AND (checkbox1 OR checkbox3)

Reported by atmorell | November 27th, 2008 @ 08:29 AM

Hey Ben,

I have constructed a search form and it works very well. There is one thing that is bugging me.

Example search form:
firstname, (input)
lastname, (input)
email, (input)
looking_for_friend (checkbox)
looking_for_love (checkbox)
looking for_wife (checkbox)

Is it possible to join the 3 looking for fields with OR instead of AND?

Best regards.
Asbjørn Morell.

Comments and changes to this ticket

  • Ben Johnson

    Ben Johnson November 27th, 2008 @ 11:09 AM

    • State changed from “new” to “resolved”

    You can't cherry pick some fields to be joined with "and" and some with "or". What you can do is pass an array to some of the conditions and they will be joined with "or" that way. But since the 3 looking for fields are separate you would have to make the whole search joined with or.

    I get requests like this a lot. My intention with searchlogic was to never replace sql or advanced searches. There is nothing wrong with using scopes or sql in your instance. Chain some named_scopes together and then use searchlogic on the end of the chain.

    I am working on something to assist with this, but I thought I'd throw that out there.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket

Pages