Skip Navigation

[Resolved] Search Filter tests “all” options instead of “any” options

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a "select" custom field that includes several options. I have created a custom search View that includes this field as a filter using checkboxes. If I check any one option, the View shows the correct results. But if I check more than one option, no results are shown.

Solution: The Query Filter in this View is configured to test using the "equal to" comparison instead of the "in" comparison. Check the attached screenshot to see this configuration in the View editor screen. Your Query Filter should use "in" to check if the posts contain any of the selected values, not all of the selected values (i.e. the "equal to" option).

If you cannot see the Query Filter section in your View editor screen, scroll to the top right corner of the screen and click "Screen Options", then you can enable the Query Filter panel.

Relevant Documentation:
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/

This support ticket is created 6 years, 7 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by christopheV-2 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#906089

Hello,

I have a select field with option1, option2, option3, option4, option5

In Views I turn this field into checkboxes
In the search filter I select option 2, it works, I select the option5 it works but if I select option2 AND option 5, it does not work

Why ?

Thank you for your reply.

#906254
Screen Shot 2018-05-30 at 11.00.18 AM.png

Hi, it sounds like the Query Filter in this View is configured to test using the "equal to" comparison instead of the "in" comparison. Check the attached screenshot to see this configuration in the View editor screen. Your Query Filter should use "in" to check if the posts contain any of the selected values, not all of the selected values (i.e. the "equal to" option).

If you cannot see the Query Filter section in your View editor screen, scroll to the top right corner of the screen and click "Screen Options", then you can enable the Query Filter panel.

#906258

It's perfect !!

big thanks