calebaq
Forum Replies Created
-
Forum: Plugins
In reply to: [Relevanssi - A Better Search] No results when using complex tax queriesThat’s what I was thinking about doing next and was trying to figure out the best way to do it. I’ll work through some ideas on Monday and see what I can come up.
Thanks for taking a look at this! If you need any specific information from me, just let me know. Happy to help anyway I can.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] No results when using complex tax queriesAh gotcha! That makes sense.
We do have a programmatic condition here that adds an
s
to the array when a search term is passed. I just didn’t include it here since I was testing just getting the conditionals to work out, otherwise I’d definitely just run through it WP_Query to keep it easy (since it worked just fine).Forum: Plugins
In reply to: [Relevanssi - A Better Search] No results when using complex tax queriesAdditional context – Results that are tagged with the first condition of having the market
germany
applied does return results. It’s only results for the second criteria that are not returning items.Looking through the MySQL output, the term IDs do match up at least. I’m not sure about that ID FROM wp_posts WHERE 1=1 condition though.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] No results when using complex tax queriesSure! It does work just fine with a simple tax queries. It only started struggling for me when I needed to work with this one specific AND case relationship.
Here is the output of that filter:
SELECT DISTINCT(relevanssi.doc), 1 AS term, 1 AS term_reverse, 1 AS content, 1 AS title, 1 AS comment, 1 AS tag, 1 AS link, 1 AS author, 1 AS category, 1 AS excerpt, 1 AS taxonomy, 1 AS customfield, 1 AS mysqlcolumn, 1 AS taxonomy_detail, 1 AS customfield_detail, 1 AS mysqlcolumn_detail, type, item, 1 AS tf FROM wp_relevanssi AS relevanssi WHERE relevanssi.term = relevanssi.term AND ( relevanssi.doc IN ( SELECT DISTINCT(tr.object_id) FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN (17) ) OR relevanssi.doc IN ( SELECT ID FROM wp_posts WHERE 1=1 AND ( SELECT COUNT(1) FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN (51,22) AND tr.object_id = wp_posts.ID ) = 2 ) OR relevanssi.doc IN ( SELECT ID FROM wp_posts WHERE 1=1 AND ( SELECT COUNT(1) FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN (12,11) AND tr.object_id = wp_posts.ID ) = 2 )) AND ( relevanssi.doc IN ( SELECT DISTINCT(tr.object_id) FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN (17) ) OR relevanssi.doc IN ( SELECT ID FROM wp_posts WHERE 1=1 AND ( SELECT COUNT(1) FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN (51,22) AND tr.object_id = wp_posts.ID ) = 2 ) OR relevanssi.doc IN ( SELECT ID FROM wp_posts WHERE 1=1 AND ( SELECT COUNT(1) FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN (12,11) AND tr.object_id = wp_posts.ID ) = 2 )) AND ( relevanssi.doc IN ( SELECT DISTINCT(posts.ID) FROM wp_posts AS posts WHERE posts.post_type IN ('job') ) ) GROUP BY doc, item, type ORDER BY doc ASC LIMIT 500