• Resolved bruffridge

    (@bruffridge)


    When I submit a new custom post with a status of pending it immediately appears as indexed in Relevanssi state of the index. Looking at the terms in the wp_relevanssi table for the post I see a few terms. The term that is missing is the custom field which I specified in the relevanssi settings. The custom field term is in the index for all the published posts. If I rebuild the index the custom field shows up in the index but the automatic indexing that happens when a post is submitted does not index it. I also tried “continue indexing” and that did not pick up the custom field either. Only the “build the index” did.

    https://wordpress.org/plugins/relevanssi/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter bruffridge

    (@bruffridge)

    I think I know what’s happening. I use custom code to insert my custom post. I call wp_insert_post, which is probably what kicks off the relevanssi indexer. THEN I call update_post_meta to set the custom field. I don’t think calls to update_post_meta kick off the indexer. Any suggestions on what I can do to make the indexer index my custom field for new posts?

    Thread Starter bruffridge

    (@bruffridge)

    Yep, looks like on line 9 of init.php the indexer only fires on wp_insert_post and does not run on calls to update_post_meta.

    add_action(‘wp_insert_post’, ‘relevanssi_insert_edit’, 99, 1 ); // added by lumpysimon

    Thread Starter bruffridge

    (@bruffridge)

    Found the answer to fix my issue on another support thread.
    https://wordpress.org/support/topic/not-auto-indexing?replies=4#post-6615493

    Plugin Author Mikko Saari

    (@msaari)

    Indeed – adding Relevanssi indexing hook on update_post_meta would be a tad heavy for most cases. But glad you got this sorted out.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom field not being indexed for pending posts.’ is closed to new replies.