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

  1. AlfalfaAnne
    Posted 2 years 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:


    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?



  2. Mikko Saari
    Plugin Author

    Posted 2 years 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
    Posted 2 years ago #

    Hi Mikko,

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

    Have a great day!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Relevanssi - A Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic