Incendiary
Forum Replies Created
-
Okay, we’ve done a little digging into the code and come up with these two issues. Firstly:
Search.php line 179 produces:
SELECT term_taxonomy_id FROM wp_terms JOIN wp_term_taxonomy USING(term_id) WHERE slug LIKE '%books%' AND taxonomy LIKE 'product_type'I’ve no idea why this is using wildcard LIKE queries, however because we have terms of
booksandebooksthis is only working for us because they come out of the database in the right order. If we’d added the terms in another order this would probably be broken.Search.php line 306: This is where the problem I describe above occurs:
if (is_array($taxonomy))This isn’t evaluating to true so the taxonomy request is not being added to the WHERE of the search query
So, we’ve added a new section underneath
elseif (is_numeric($taxonomy) && $taxonomy > 0)
to check to see if it’s actually a number rather than an array. Whether this is the best way to deal with that, or why$taxonomyisn’t an array I don’t know – however that’s how we’ve fixed it!Hope this helps!
Hi Mikko – would it help if you could access the install’s admin panel? I can’t provide the URL on here but I could send you across some details via e-mail? Thanks for your help so far!
Yeah, very sure. Deactivating the plugin changes the search results and I also have features like excluding by tag and weights working so I’m definitely getting back data from Relevanssi.
Hi Mikko,
Thanks for your reply – unfortunately that URL doesn’t restrict the search either. Could there be some setting that I’ve missed? Either in the creation of the taxonomy or within Relevanssi?
Hmm, that doesn’t seem to work either. This is what I did:
Applied a custom taxonomy to Pages.
Set a page to use a term from that taxonomy.
Reindexed.
Tried a search like: ?s=destination&product_type=booksThe results don’t change with the addition of the product_type=books in the URL 🙁