No results when using complex tax queries
-
I might be missing something basic, but we have a custom API route that we are using to fetch data and use taxonomies to filter down the data. We have a complex tax query to look for posts that are either located in a specific market OR one of a specific market AND one of a specific preference.
This query works as expected when we are not having it go through Relevanssi, but then returns no results if we use Relevanssi. If a post has all of the tags, then it will return, but not if just one of the tags in each taxonomy. It almost feels like the compare IN isn’t working for me when Relevanssi is being used. Here is the query for reference.
[ "posts_per_page" => "20", "offset" => 0, "post_type" => "job", "orderby" => "post_date", "order" => "DESC", "relevanssi" => true, "tax_query" => [ "relation" => "OR", [ "relation" => "AND", [ "taxonomy" => "market", "field" => "slug", "terms" => [ "amsterdam", "paris" ] ], [ "taxonomy" => "offsite_preference", "field" => "slug", "terms" => [ 0 => "either", 1 => "offsite" ] ] ], [ [ "taxonomy" => "market", "field" => "slug", "terms" => [ 0 => "germany" ] ] ] ] ]
Any advice or things I can try? Let me know if I can provide any additional information.
- The topic ‘No results when using complex tax queries’ is closed to new replies.