WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Using Relevanssi with Advanced Custom Fields (3 posts)

  1. AlfalfaAnne
    Member
    Posted 10 months ago #

    Great plugin!

    I've run into an issue though when I'm trying to search through the subfields in a repeater field for advanced custom fields. The only other post I could find that mentions the repeater add-on is here:

    http://wordpress.org/support/topic/plugin-relevanssi-a-better-search-remove-ellipsis-on-custom-excerpt?replies=2

    When I add a custom field name to be included in the search, it works perfectly, but it doesn't seem to do the same for a subfield (which is what the repeater add-on creates).

    Is there a solution to get Relevanssi to include those subfields in the search results?

    Thanks!

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

  2. Mikko Saari
    Member
    Plugin Author

    Posted 10 months ago #

    Looking at the documentation, if the custom field is called 'repeater' and there's a subfield 'content', the data is stored in custom fields 'repeater_0_content', 'repeater_1_content' and so on.

    The easiest solution here is to set the Relevanssi custom field setting to "visible" or "all", which will grab all the custom fields. More refined approach is to use relevanssi_index_custom_fields filter hook to check for the presence of subfields and add them if necessary.

  3. AlfalfaAnne
    Member
    Posted 10 months ago #

    Hi Mikko,

    Thanks so much for the quick response! Your suggestion was really helpful and worked for me.

    Have a great day!
    Anne

Reply

You must log in to post.

About this Plugin

About this Topic