ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Can the exp:channel:entries "search=" parameter do EITHER/OR searching?

August 30, 2011 3:43pm

Subscribe [4]
  • #1 / Aug 30, 2011 3:43pm

    vosSavant

    380 posts

    I’ve tested this and can’t get the search= parameter to do my bidding. Basically, I’d like to pull a list of entries that are either authored by a user or have some custom field set to a certain value. Alternatively, I could search by an entry having either custom field A or custom field B set to a value.

    However, the parameter only seems to respect AND searching (that is, the entry must have both values). I’ve done some experimenting and searching around, but the only solution seems to be using exp:query to perform a join.

    For instance, I’d like the following to return entries that match EITHER search term, but EE only returns entries that match BOTH search terms:

    {exp:channel:entries search:style="=ale" search:region="belgium"}

    Is this the way it is, or am I just a n00b? Does EE’s search parameter let you do OR searching?

  • #2 / Aug 31, 2011 3:26am

    John Henry Donovan

    12339 posts

    Hi Ryan,

    Yes this seems the case when using the parameter multiple times. In your case it will return only an entry which has both those search terms in. feel free to make a feature request to add to this functionality

    Solspace’s SuperSearch could do this for you or if you were to rejig your site architecture Belgium could be a category maybe?

  • #3 / Aug 31, 2011 8:20am

    Dave @ Exp:resso

    465 posts

    Another option would be to use the query module, you could write any conditionals/criteria you want in there.

  • #4 / Aug 31, 2011 1:56pm

    vosSavant

    380 posts

    John,

    Thanks for the feedback and confirmation. I just made a feature request.

    @Dave, I am using the query module now; unfortunately, it does not work with a 3rd party pagination module. Apparently, there are no pagination hooks for the query module.

    Feel free to close this one out.

  • #5 / Aug 31, 2011 7:46pm

    Marcus Neto

    1005 posts

    Closing as requested. Don’t hesitate to ping us again if you have any other issues.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases