• Resolved david57

    (@david57)


    After update to 3.1.1, I am getting the same related post on every page of https://www.bibletruths.org/. And the related post is not contextually related at all. I have tried reseting the settings to default and recreating the indexes. But nothing changes. Here are my current settings.

    {"cache_posts":0,"cache":1,"add_to":{"single":"single","page":"page"},"content_filter_priority":"999","insert_after_paragraph":"-1","same_taxes":"","match_all":0,"no_of_common_terms":"1","disable_on_mobile":0,"disable_on_amp":0,"uninstall_options":1,"uninstall_indices":1,"uninstall_indices_deactivate":0,"show_metabox":1,"show_metabox_admins":0,"show_credit":0,"limit":"6","daily_range":"0","ordering":"relevance","random_order":0,"match_content":1,"match_content_words":"0","post_types":"post,page","same_post_type":0,"same_author":0,"exclude_post_ids":"","exclude_cat_slugs":"","exclude_categories":"","disable_contextual":0,"disable_contextual_cpt":0,"title":"<h3>Related Posts:<\/h3>","blank_output":"blank","blank_output_text":"No related posts found","show_excerpt":0,"excerpt_length":"10","show_date":0,"show_author":0,"title_length":"60","link_new_window":0,"link_nofollow":0,"exclude_output_header":0,"exclude_on_post_ids":"","exclude_on_post_types":"","exclude_on_cat_slugs":"","html_wrapper_header":0,"before_list":"<ul>","after_list":"<\/ul>","before_list_item":"<li>","after_list_item":"<\/li>","post_thumb_op":"inline","thumb_size":"crp_thumbnail","thumb_width":"150","thumb_height":"150","thumb_crop":1,"thumb_create_sizes":1,"thumb_html":"html","thumb_meta":"post-image","scan_images":1,"thumb_default_show":1,"thumb_default":"https:\/\/www.bibletruths.org\/wp-content\/plugins\/contextual-related-posts\/default.png","crp_styles":"rounded_thumbs","custom_css":"","feed_options_desc":0,"limit_feed":"5","show_excerpt_feed":0,"post_thumb_op_feed":"text_only","thumb_width_feed":"250","thumb_height_feed":"250","exclude_on_categories":""}

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Ajay

    (@ajay)

    I checked the site, but do note that a lot of the posts are repeated. I’m not sure if this is a FULLTEXT index issue. Can you try unchecking the setting which is to match content as well as title to see if this improves?

    In the next version, I’m planning to add some weighting to ensure more weight is given to the title vs the content.

    Hi @ajay,

    we are facing the same issue… All of a sudden the related posts are identical (with the exception of the current post being excluded from the list) :-/

    I tried:

    • Clearing the cache
    • Tweaking the setting for “Related posts based on title and content” (title only before but no change)

    How can I debug the query args that are being applied to the related posts query? Do you think there is an issue with the indexer?

    Something else: Since saving the settings doesn’t automatically clear the cache any more you should alter the text on the tools page –> Clear the Contextual Related Posts cache. This will also be cleared automatically when you save the settings page.

    Thanks for looking into this and especially for developing & maintaining this plugin!

    Just downgraded to v3.0.7 and this resolves the issue – the variance returns and the posts shown are much more targeted and ‘related’ then with the newer plugin versions…

    Plugin Author Ajay

    (@ajay)

    @leanderbraunschweig

    I’ll run some tests at my end. Clearly looks like something introduced in 3.1.1 that’s broken it down.

    I think it might be the stopwords check that I had to include which could be causing this problem.

    Plugin Author Ajay

    (@ajay)

    @leanderbraunschweig

    I haven’t been able to replicate this on my install. I get the same set of posts with both versions of the plugin.
    Can you please show me the examples of what you’re seeing in the current version vs 3.0.7?

    Also, are you in a position to check the query? I’m wondering if instead of by score it’s getting sorted by date.

    Hi @ajay,

    thanks for testing on your install & getting back!

    I went ahead and set up a development environment and updated to v3.1.1 in order to be able to directly compare the results and the underlying queries.

    At first everything appeared to working fine but after re-indexing and clearing the cache the issue became apparent again…

    An exemplary query / request would be this:

    string(738) "SELECT   wp_posts.*,  MATCH (wp_posts.post_title,wp_posts.post_content) AGAINST (' Sie emotional abhängig Ihrem Partner?')  as score  FROM wp_posts  WHERE 1=1  AND ( 
      wp_posts.post_date <= '2022-02-15 12:44:48'
    ) AND wp_posts.ID NOT IN (4239) AND wp_posts.post_type = 'post' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'inherit')) AND  MATCH (wp_posts.post_title,wp_posts.post_content) AGAINST (' Sie emotional abhängig Ihrem Partner?')   ORDER BY FIELD(wp_posts.ID, 5162,5143,4927,4818,4787,4368,4235,3915,3628,3579,2960,2961,2495,1564,1970,1980,629,1269,1254,1986,1560,1440,577,728,1567,605,613,3500,3470,3708,1555,1443,3967,2424,3547,1455,4239,1976,1427,619,621,624,627) DESC, wp_posts.post_date ASC LIMIT 0, 8"

    The same post on the live site running v3.0.7 yields this request:

    string(710) "SELECT   wp_posts.*,  MATCH (wp_posts.post_title) AGAINST ('Sind Sie emotional abhängig von Ihrem Partner?')  as score  FROM wp_posts  WHERE 1=1  AND ( 
      wp_posts.post_date <= '2022-02-15 12:51:46'
    ) AND wp_posts.ID NOT IN (4239) AND wp_posts.post_type = 'post' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'inherit')) AND  MATCH (wp_posts.post_title) AGAINST ('Sind Sie emotional abhängig von Ihrem Partner?')   ORDER BY FIELD(wp_posts.ID, 5162,5143,4927,4818,4787,4368,4235,3915,3628,3579,2960,2961,2495,1564,1970,1980,629,1269,1254,1986,1560,1440,577,728,1567,605,613,3500,3470,3708,1555,1443,3967,2424,3547,1455,4239,1976,1427,619,621,624,627) DESC, wp_posts.post_date ASC LIMIT 0, 8"

    Comparing the two requests I can see that the AGAINST-value is differentiating and this most probably is due to the stopword check.

    Removing “Sind” & “von” is actually a great feature but I there must be something wrong with either how the string is handled (see the empty space at the start, could be troublesome for MySQL maybe?) or the index is being built with this regard?

    Thanks for your assistance so far and luckily we could narrow the issue down a bit…!

    If you need (frontend-)access to our DEV environment in order to view a few more queries then just let me know and I’ll send over the details.

    Plugin Author Ajay

    (@ajay)

    @leanderbraunschweig

    Thank you for checking. Are you able to make a code change in v3.1.1 and replace the line below with just $search = array();

    https://github.com/WebberZone/contextual-related-posts/blob/ee4910152f76d94076921d3c819f9ea3cbaa6153/includes/class-crp-query.php#L442

    I’m curious to see what happens in that case and if you get better posts. I wasn’t able to get it to work on my install.

    I’m thinking i might need to do algorithm changes in the next version to better give value to the title.

    @ajay

    Thanks for getting back and sorry for the late reply…

    I changed the line as suggested, re-created the indices and cleared the plugin cache but the related posts still appear in an identical fashion (only the current post gets substituted).

    So unfortunately (?) the stopwords are not responsible for the change.

    Any other ideas?

    Thanks & regards!

    Plugin Author Ajay

    (@ajay)

    Clearly not the stopwords – which verifies my findings on my install.

    I think I figured out the issue. And it’s likely not the stopwords, but likely because of this change which I realise causes issues because you only search for the title (not content).

    For now, in your version would you be able to reverse the code and test? Let me know if it’s clear or if you need help on that?

    I reverted said change, recreated the indices and cleared the cache – and this did the trick…!

    The related posts are not identical any more 🙂

    Maybe you can re-work this to apply to each situation (title only / title & content)?

    Looking forward to the next version and many thanks for your input and efforts regarding fixing this!

    Plugin Author Ajay

    (@ajay)

    Thanks for confirming. My plan for the next version is to add some weighting options that users can pick/blend. I do a similar thing in my plugin Better Search.

    This will demise the “Include content” option but provide a weightage of 100 to title and 1 to content as default which I tested probably gives the best matching of uniqueness.

    GitHub report filed: https://github.com/WebberZone/contextual-related-posts/issues/160

    Great, thanks a lot for all your work!! 🚀

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Same related post on every page after update to 3.1.1’ is closed to new replies.