Skip Navigation

[Resolved] how to modify search within a taxonomy to OR instead of AND

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 22 replies, has 2 voices.

Last updated by Minesh 6 months ago.

Assisted by: Minesh.

Author
Posts
#2698190
Screenshot 2024-05-16 at 15.57.27.png
Screenshot 2024-05-16 at 15.57.18.png

In this page hidden link I have a search filter that searches within 3 different taxonomy.
The filter correctly narrows down the results when crossing different taxonomy group, but I need to also restrict inside each taxonomy.

Right now, if I choose two different values, I get more results, while I would like it to narrow it further down. I guess what I need is switching from a AND search to a OR search within each taxonomy group.

How do I do that?

Thank you

#2698311

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I would like to know what if your expected results when I select different terms from different taxonomies. Can you please share test case example and send me admin access details and let me check what could be the possible solution I may offer you.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2698320

Hi Minesh, thank you for your support.

I give you an example of expected result. Here: hidden link in the Technology taxonomy filter, if I choose "Drying", I will have 5 results, which is correct. But if I add the "Fast cooling" option, I get 8 results instead of "0", which should be the correct result as there are no product that have at the same time the 2 options.

Thank you!

#2698321

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Unfortunately - the admin access details you shared is not working at this end.

Can you please share admin access details or your main site so I can review your view's custom search filter settings and check what could be the possible solution.

*** Please make a FULL BACKUP of your database and website.***
I have set the next reply to private which means only you and I have access to it.

#2698341

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I see you have added multiple taxonomy filters. Do you want to apply the same concept to other taxonomies as well?

#2698342

Hi Minesh,
yes, the same principle should apply for the 3 taxonomies. The goal of the search is to narrow down the results as much as possible

#2698347

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You should select your view block and on right sidebar within the "Content Selection" tab you will see a "Query Filter" section for your taxonomy filters. Where I've changed the value to "All Values" as you can see with the following screenshot:
- hidden link

Can you please confirm it works as expected now.

#2698348
Screenshot 2024-05-17 at 16.17.04.png

Hi Minesh,

Apparently, the change only works for technology, not for the other taxonomies.

If for instance I select Applications=geometrias complejas, I get the correct results (3 results).
But if I further select adding "residuos biopeligrosos", I get the same 3 results when in reality there should be only one...

#2698354

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

If for instance I select Applications=geometrias complejas, I get the correct results (3 results).
But if I further select adding "residuos biopeligrosos", I get the same 3 results when in reality there should be only one...
==>
I can see only one result in this case, please check the following screenshot:
-hidden link

Maybe you should try to clear the cache or reload the page and then test.

You have to follow the same principal for all other taxonomies where you want to apply this "AND" clause between terms for the taxonomies.

#2698362

You are right, it might have been a cache issue then, both applications and technology work fine, that is great!

The only taxonomy that still does not work is the last one, "traceability". I think that is because in the query filter is configured differently.
Is there a way to make it work like the other two taxonomies?

#2698615

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The only taxonomy that still does not work is the last one, "traceability". I think that is because in the query filter is configured differently.
Is there a way to make it work like the other two taxonomies?
==>
For that you will have to delete the existing taxonomy frontend filter for taxonomy "traceability" from your view's section where you added the search field and then save your view and reload your page and navigate to "Content Selection" area and remove query filter if it's available for the taxonomy "traceability". Then try to re-add the taxonomy frontend filter for taxonomy "traceability" by clicking on the "Add Search Field" and then make sure to select the correct comparison option from "Fields Settings" tab on right sidebar for this taxonomy filter.

#2698647
Screenshot 2024-05-20 at 15.42.12.png

Thank you Minesh.

I have followed your advice, but I have not been able to make it work: every time, the last taxonomy is automatically chosen as the base and there is no option to change that (see the attached screenshot)...

#2698739

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You will have to try to remove other frontend filters and then try to re-add frontend filter one by one and change the filter comparison to "All Values" to each of your taxonomy filter one by one and then try to save your view and page.

#2698828
Screenshot 2024-05-21 at 15.36.35.png

Yes, that's what I did. But it does not seem to work.

I have 3 filters: technology, applications, traceability. I have removed the three and started adding them from scratch. The last one I add, no matter which one s it, doesn't have options as the other two, it's automatically set as "filter based on the frontend search filter by..."

#2698921

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please send me duplicator copy of your site - I think I will have to dive in to see what's exactly causing this issue.

More info:
- https://toolset.com/faq/provide-supporters-copy-site/

I have set the next reply to private which means only you and I have access to it.