Skip Navigation

[Resolved] Using AND – OR logic on custom search

This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 6 replies, has 3 voices.

Last updated by Beda 6 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#523232

I have created a working search on this site:

hidden link

I cannot remember where or how I put the AND / OR logic in the search logic. When the user toggles each field, it is working with AJAX to refresh the results which is nice but I noticed when they toggle MORE boxes in each category, more items show up.

My client is more keen on having specific targeted results show up meaning I need to use AND logic instead of OR I think.

As the user toggles more boxes, eventually the results should be empty if there are no matching posts. Hopefully, this makes sense.

Cheers
Woody

#523334

Dear Woody,

There isn't such a built-in feature within Views plugin, and you are right, Views is using OR logic for the checkboxes field, if you agree, we can take it as a feature request, our developers will evaluate it.

#524760

Not sure this makes sense Luo ... I know I had it working somewhere else at one point. I will check my other sites but would like you to escalate this request to another Team member for a second opinion please.

Clarity : When using a parametric search with checkboxes for various custom fields, I would like to be able to filter down to the specific results on each "multiple check" of the checkboxes. In other words, when a user keeps clicking on checkboxes to REFINE ANY SEARCH, the results shown should eventually go to NO RESULTS FOUND after filtering down in great detail.

As it is now, the results are showing ALL entries using "OR" logic.

Woody

#524765

On this site, hidden link, it seems to work with AND/OR search but the difference seems to be with the DROP DOWN FIELDS instead of CHECKBOXES.

Is this the issues with AND/OR?

Woody

#524993

As your request, I re-assign this ticket to the appropriate supporters.

#524995

Thanks for that.

UPDATE - the Prestigious Properties site is using DROPDOWN selectors where ONE ONLY choice can be selected.

In the final search, it seems this allows the use of AND logic so that when any dropdown is selected, the other dropdown choices filter down to any other settings also available for posts.

My client really likes this type of parametric search with dropdown fields more than the checkboxes I have used to date. I will be changing over to dropdown boxes and calling it a day.

However, if there IS a way or method to use checkboxes in parametric search with AND logic, that would be most appreciated input.

Thanks for your great support mate.

Woody

#525123
Bildschirmfoto 2017-05-17 um 16.32.21.png
Bildschirmfoto 2017-05-17 um 16.32.39.png

When you setup a Custom Filter with Views you are usually using the "New Filter" button in the "Filter Editor".

There, once the GUI pops up, you can choose all those comparison operators you want.

I added 2 Screenshots, one of a Taxonomy and one of a Field.

Is that what you where looking for?

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.