thpapag
Forum Replies Created
-
closing the ticket as solved
i found it!!!
for some reason, which i cannot understand I had these lines of code in my child theme.
/* relevanssi search */ add_filter(‘relevanssi_index_content’, ‘__return_false’); add_filter(‘relevanssi_fuzzy_query’, ‘rlv_partial_inside_words’); function rlv_partial_inside_words($query) { return “(term LIKE ‘%#term#%’)”; }
once again I really appreciate the time and effort you spent for me. I will definitely tell my client to purchase your pro version. This professional support is top priority for me!
thank you and have a nice day
Thank you very much for your help and your time, I will investigate on my own and I will post the solution here.
nothing strange!
the product saved successfully and yet no SKU of variations in debug
look, the filter was working on admin search because I had variation post type selected, not because of the filter.
when I removed the product_variation from indexing, and rebuild the indeed, the admin search stopped finding the variation product using sku!
it seems that the php filter is not working as expected.
can you imagine a reason why the additional content is not appended?
i will search for the answer of upsolutions tomorrow.
regarding the relevanssi_content_to_index filter, when I tried to see what I am getting in your debug screen, I am not getting the variations SKUs. Is this correct in your opinion?
i would expect to get all variations SKUs
212088 is the ID of the parent product. When I query the below sql shouldn’t I receive all the SKUs of the variations? I am not getting any variation sku in the results. Is this a good point to start digging?
SELECT * FROM
wp0m_relevanssiWHEREdoc= 212088i added this in my child theme php functions
add_filter(‘relevanssi_content_to_index’, function ($content, $post) { if (‘product’ === $post->post_type) { $args = array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘product_variation’, ‘posts_per_page’ => -1 ); $variations = get_posts($args); if (!empty($variations)) { foreach ($variations as $variation) { $sku = get_post_meta($variation->ID, ‘_sku’, true); $content .= ” $sku”; } } } return $content; }, 10, 2);
Yes, I confirm that it is working correctly from the admin search. Also from Ajax live search while typing in the front end.
i am using Impreza theme.
the search template is build using grids from the plugin.
this is the sql query from this filter “relevanssi_query_filter”
u034470 is the SKU from the variation
SELECT DISTINCT(relevanssi.doc), relevanssi.*, relevanssi.title * 5 + relevanssi.content * 1 + relevanssi.comment * 0.75 + relevanssi.tag * 1 + relevanssi.link * 0 + relevanssi.author + relevanssi.category * 1 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM wp0m_relevanssi AS relevanssi WHERE relevanssi.term = ‘u034470’ AND relevanssi.doc NOT IN (1693) AND ( relevanssi.doc IN ( SELECT DISTINCT(posts.ID) FROM wp0m_posts AS posts WHERE posts.post_type IN (‘product’) ) ) ORDER BY tf DESC LIMIT 500
one more detail, when I am using live search while typing I am getting the result! So your plugin is working obviously.
But when I press enter key, no results in my search page.
so the problem is somewhere in my theme but I have no idea where to start looking π