WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Custom field data isn't been indexed when posted from front-end. (3 posts)

  1. AndrewMunro
    Member
    Posted 1 year ago #

    Hi there, thanks for the plugin. I have a small form on the front end that simply adds a custom field using add_post_meta. Since it's submitted from the front-end, I need to run the indexing again from the plugin's settings in order for it to pick up the custom field data. Is there some way I can hook into your plugin while I'm doing my add_post_meta so that relevanssi indexes it straight away?

    I saw this function but unsure if it's relevant to me:
    relevanssi_index_doc($id, $remove_first, $custom_fields, $bypasspost);

    I should note that I'm not creating a post from the front-end, just adding some custom data for the currently displayed post.

    Thank you!

    http://wordpress.org/extend/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that is very much the relevant function.

    Call it like this:

    relevanssi_index_doc($post_id, true, relevanssi_get_custom_fields(), true);

    to update a post.

  3. AndrewMunro
    Member
    Posted 1 year ago #

    Thank you very much, works perfectly :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic