Home Forums Front-end Issues Parametric search on layout fields Reply To: Parametric search on layout fields

  • The data in checkbox, multiselect, relationship, repeater and flex fields is not easily searchable. The first 3 store data in serialized arrays and the last 2 store data across several fields with slightly different meta_key values that can get quire complex depending how how deeply they are nested.

    Because of this there are two choices that I’ve found.

    1) A plugin and maybe an add on that is specifically designed to search this type of data
    2) Converting the data to as easily searchable storage method, I.E. in the way WP stores meta data across multiple database rows with the same meta_key.

    I have not found anything that I’m satisfied with that fits #1 and I’ve been looking for a long time.

    2 is the easier method. You can create a save post hook that takes the data from these fields and stores them into a hidden custom field (starts with an underscore) and then search these fields instead of trying to search ACF fields directly. I’ve actually been inspired by the filters in one search tool to build a converter plugin.