• Hi,

    After publishing new posts, I found that I have to recreate the index to actually update which posts are considered related. This becomes especially apparent on blogs with few posts which thus has little content to draw on.

    Please recreate the index and clear out the cache automatically for me when publishing new posts. It shouldn’t be necessary to do this manually.

    This little addition does the trick for me:

    function crp_on_publish_post( $ID, $post ) {
            crp_delete_index();
            crp_cache_delete();
            crp_create_index();
    }
    add_action( 'publish_post',  'crp_on_publish_post', 10, 2 );

    https://wordpress.org/plugins/contextual-related-posts/

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

    (@ajay)

    This would only be good for small blogs. For big ones, this would cause a long delay in the post publishing process.

    Usually you don’t need this since the index automatically includes new posts.

    Thread Starter Dan

    (@geekysoft)

    So why aren’t I seeing new posts show up in old posts where they would be related? A full week after publishing a new post, it still doesn’t show up on old posts. When I clean the cache and recreate the index, they show up immediately.

    Plugin Author Ajay

    (@ajay)

    The index is supposed to refresh automatically on data change.

    You might need to check the index contents:
    https://dev.mysql.com/doc/refman/5.7/en/myisam-ftdump.html

    However, as long as you’re not talking about a few 1000 posts your script above should work well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Automatically recreate the index when new posts are published’ is closed to new replies.