• Resolved byronbehm

    (@byronbehm)


    Hello! I’m using Avada 5.9.1 and the latest version of Relevanssi. My search results stopped working recently (it was working fine before) I believe after some recent plugin/theme updates.
    Avada’s search.php file: https://pastebin.com/mP4aTQUJ

    I tried the debugging process by adding the snippets into Avada’s theme functions.php.

    The Parameters Relevanssi is Getting:
    Message: array(68) { [“s”]=> string(4) “test” [“post_type”]=> array(4) { [0]=> string(15) “avada_portfolio” [1]=> string(9) “avada_faq” [2]=> string(4) “page” [3]=> string(4) “post” } [“error”]=> string(0) “” [“m”]=> string(0) “” [“p”]=> int(0) [“post_parent”]=> string(0) “” [“subpost”]=> string(0) “” [“subpost_id”]=> string(0) “” [“attachment”]=> string(0) “” [“attachment_id”]=> int(0) [“name”]=> string(0) “” [“static”]=> string(0) “” [“pagename”]=> string(0) “” [“page_id”]=> int(0) [“second”]=> string(0) “” [“minute”]=> string(0) “” [“hour”]=> string(0) “” [“day”]=> int(0) [“monthnum”]=> int(0) [“year”]=> int(0) [“w”]=> int(0) [“category_name”]=> string(0) “” [“tag”]=> string(0) “” [“cat”]=> string(0) “” [“tag_id”]=> string(0) “” [“author”]=> string(0) “” [“author_name”]=> string(0) “” [“feed”]=> string(0) “” [“tb”]=> string(0) “” [“paged”]=> int(0) [“meta_key”]=> string(0) “” [“meta_value”]=> string(0) “” [“preview”]=> string(0) “” [“sentence”]=> string(0) “” [“title”]=> string(0) “” [“fields”]=> string(0) “” [“menu_order”]=> string(0) “” [“embed”]=> string(0) “” [“category__in”]=> array(0) { } [“category__not_in”]=> array(0) { } [“category__and”]=> array(0) { } [“post__in”]=> array(0) { } [“post__not_in”]=> array(0) { } [“post_name__in”]=> array(0) { } [“tag__in”]=> array(0) { } [“tag__not_in”]=> array(0) { } [“tag__and”]=> array(0) { } [“tag_slug__in”]=> array(0) { } [“tag_slug__and”]=> array(0) { } [“post_parent__in”]=> array(0) { } [“post_parent__not_in”]=> array(0) { } [“author__in”]=> array(0) { } [“author__not_in”]=> array(0) { } [“posts_per_page”]=> int(20) [“order”]=> string(3) “ASC” [“orderby”]=> string(5) “title” [“ignore_sticky_posts”]=> bool(false) [“suppress_filters”]=> bool(false) [“cache_results”]=> bool(true) [“update_post_term_cache”]=> bool(true) [“lazy_load_term_meta”]=> bool(true) [“update_post_meta_cache”]=> bool(true) [“nopaging”]=> bool(false) [“comments_per_page”]=> string(2) “20” [“no_found_rows”]=> bool(false) [“search_terms_count”]=> int(1) [“search_terms”]=> array(1) { [0]=> string(4) “test” } [“search_orderby_title”]=> array(1) { [0]=> string(168) “wp_yqti_posts.post_title LIKE ‘{2e46e6352b4b63abc33b070fe083704fdc08bccce996dd694f92d9b993baf76e}test{2e46e6352b4b63abc33b070fe083704fdc08bccce996dd694f92d9b993baf76e}'” } }

    The other Debugging options like the SQL Query just lists an array. Are there any noticeable issues that you can see in the theme and relevanssi? is there another file you would like me to upload?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Mikko Saari

    (@msaari)

    The most common issue with Avada is that the Avada settings for post type in search override the settings in Relevanssi, resulting in some post types missing from the results. The solution for that is to clear out the Avada search post type setting and leave that to Relevanssi.

    In your case the search is restricted to avada_portfolio, avada_faq, page and post. That sounds like it should show some results. All other parameters are empty, so that’s not a problem either.

    What does this print out?

    add_filter( 'relevanssi_query_filter', 'rlv_check_mysql' );
    function rlv_check_mysql( $query ) {
        var_dump( $query );
        exit();
    }
    Thread Starter byronbehm

    (@byronbehm)

    Thanks for your reply! This is what it prints out when I run the MySQL query:

    string(608) “SELECT DISTINCT(relevanssi.doc), relevanssi.*, relevanssi.title * 1.25 + relevanssi.content * 1 + relevanssi.comment * 0.75 + relevanssi.tag * .85 + relevanssi.link * 0 + relevanssi.author + relevanssi.category * 2 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM wp_yqti_relevanssi AS relevanssi WHERE relevanssi.term = ‘test’ AND ( relevanssi.doc IN ( SELECT DISTINCT(posts.ID) FROM wp_yqti_posts AS posts WHERE posts.post_type IN (‘post’, ‘page’, ‘avada_faq’, ‘avada_portfolio’) ) ) ORDER BY tf DESC LIMIT 500”

    I believe this was after I changed a few search parameters in Avada (to only posts, pages, avada_faq, and avada_portfolio). Avada’s search settings are: https://theme-fusion.com/documentation/avada/options/search-functionality-in-avada/

    When I run: “Look at the results” from the debugging documentation.
    add_filter( ‘relevanssi_results’, ‘rlv_check_results’ );
    function rlv_check_results( $results ) {
    var_dump( $results );
    exit();
    }

    This is what I get returned: array(0) { }
    I would assume that I should get something back when I perform that request.
    Let me know if there is another test I can run. Thanks!

    Plugin Author Mikko Saari

    (@msaari)

    Ok, nothing weird in the query, the only restriction is the post type restriction. Does the Relevanssi admin search (Dashboard > Admin search) find any results? If you try different types of words (eg. a word in a title, a word in post content), does anything work?

    Next step I’d look at the indexing settings: everything good there? All the right post types indexed, do you have a complete index?

    Thread Starter byronbehm

    (@byronbehm)

    After doing more tests with different categories (pages, posts, etc) I’m seeing some strange results. Right now my index is built based primarily on an additional plugin’s “posts” which are based on an Encyclopedia that the site has. https://snag.gy/5zaJqO.jpg
    and https://snag.gy/ZhEuMO.jpg

    When I turn off the Encyclopedia and rebuild the index (to just look for “pages” only) it will display results. However, when I build the index with the Encylopedia (5,284 posts), it won’t display anything. What is also strange is that it has been displaying posts from the Encylopedia in the past but is not able to do it now. Do you think this could be a database issue or Relevanssi’s ability to read from the Encylopedia index?

    Plugin Author Mikko Saari

    (@msaari)

    Well, you won’t see any Encyclopedia posts, because your Avada search settings restrict the search to posts, pages, Avada FAQs and Avada portfolios. That’s why there are no Encyclopedia posts in the results: Avada says no.

    Clear out those post type restrictions from the Avada search settings, leave all that empty and let Relevanssi determine which posts are shown. That should get you those Encyclopedia entries back.

    Thread Starter byronbehm

    (@byronbehm)

    You were absolutely correct! This must have been a new feature in Avada to narrow the search results and it overrode Relevanssi’s ability to look at the encyclopedia posts. I turned off the Avada theme search options and it’s working fine again.

    Thank you for all your help troubleshooting this issue. Hopefully, for those who use Avada, my mistake/lesson can help save someone else some time and headache.

    Thank you again!

    Plugin Author Mikko Saari

    (@msaari)

    Yeah, it’s a new feature, and yeah, I’ve come across it quite a few times already =)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘No Search Results’ is closed to new replies.