Skip Navigation

[Resolved] Faceted Search by Multiple Taxonomies: All Terms Unavailable

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

Problem: I have a custom search View that includes several taxonomy select filters. Some of the taxonomy terms do not appear in the filter list.

Solution: In this case, the WP Engine backend has a limit on the size of SQL queries your site can perform. You can disable that limit using this custom code in wp-config.php:

define( 'WPE_GOVERNOR', false );
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)

This topic contains 17 replies, has 2 voices.

Last updated by Christian Cox 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#922541

I am trying to search for CPTs ("procedures" - vehicle procedures) by 3 custom taxonomies (year, make, and model). When I have tested with 20 procedures in the database, all works well: you pick a year and the form refreshes to only show available makes and models, etc.

However, when I add in all 8,400 procedures, the form disables all terms in all taxonomies.

Link to a page where the issue can be seen: hidden link

#922704
Screen Shot 2018-07-09 at 4.42.52 PM.png
Screen Shot 2018-07-09 at 4.42.57 PM.png
Screen Shot 2018-07-09 at 4.43.04 PM.png
Screen Shot 2018-07-09 at 4.43.13 PM.png

Hi, can you give me some additional information? When I visit the /search page using Google Chrome on a Mac, I see a search form. I can select a Year, then the form updates and I can select a Make. Then the form updates again and I can select a Model, and updates again and I can select a Drive Train. Am I misunderstanding how the form should work? Is there a problem apparent in another browser or operating system? Can you clear your browser cache and try again? I'm attaching screenshots here showing what I see. I checked and it looks like over 8000 Procedures are published, so I think I'm looking at the correct data set.

#922719

Sorry! Here's the correct URL: hidden link

Currently it's set to only look at the first 7 years in the first dropdown. If I add any more years, it kills everything :/

#922720

This is an alternative I'm using that uses one hierarchal taxonomy for searching. It works, but URLs are messy and I'm hoping to find something more performant. What's the best way to approach this problem using Toolset?

#923118

Hi, I was trying to narrow down the problem on staging and I must have deactivated a required plugin. I tried using the SFTP credentials you provided but was unable to connect. Can you log in and activate a default theme temporarily so I can continue testing?

#923131

Try it now.

#923133

Thanks, testing again. I'll update you shortly.

#923138

I don't see anything obviously wrong here, and the problem occurs with a default theme and only Types and Views active, so there doesn't seem to be a plugin conflict. I'll need to investigate in more detail. Would it be possible for me to get a SQL dump file from your database? Please provide a download link here and I'll take a closer look.

I have reactivated the previous theme and the plugins that were active before I began testing.

#923146
#923607

I think you're going in the right direction with multiple taxonomies, given the current state of the software. One hierarchical taxonomy probably won't be very good User experience, because there is no way to break up the different levels into multiple select fields in the search form. In other words, your Users will no longer be able to stagger input by Year / Make / Model. Instead you will have one giant taxonomy selection list with all the terms jumbled up together.

Different post types is another option, with M2M relationships between each post type. However, I think you will run into similar issues with limited search capabilities. For example, it's not currently possible to allow Users to select more than one post relationship in a custom search form with the auto-updating input fields, without some complex custom code.

So yes, I think multiple taxonomies are a good approach here. I'm continuing to investigate with your data file, please stand by and I will update you soon.

#923638

Okay on my local environment I'm not able to replicate this exact problem after importing your data set. The page load time is a bit slow, but I'm able to activate all Year filters and see other filter options. Can you activate server logs and see if any messages indicate something might be failing? If you're not familiar with server logs I can show you how to activate them temporarily. Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

Then add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

Add 2005 to the year filter and refresh the search page. If any server-side errors are thrown, this will create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the changes you made to wp-config.php.

#923760
Screen Shot 2018-07-11 at 4.21.54 PM.png

No file gets generated and no errors are thrown :/

#924119

Can you temporarily disable the WPEngine object cache and test again? I'm seeing some documentation that seems to indicate some compatibility issues with WPEngine object caching and parametric searches with "only show available inputs" selected.

#924162

I never turned the caching on for this site setup :/

From their support: "Object cache is not enabled for that Zack, in fact it is cache free"

#924355

Okay thanks. Let's try one other thing, please add this code to your wp-config.php file:

define( 'WPE_GOVERNOR', false );