Admin
Content Model

Allow searching for ACFs

3min

Summary

ACFs can be configured in the Hub to be indexed for search.

Description

ACFs can be configured in the Hub to be indexed for search. When publishing a content, all values of the selected ACFs are concatenated and published into a new field "customSearchTerms" and then indexed by the indexing service. This new field can then be included for full-text searches in the Catalog-API using a new enum value "CUSTOM_TERMS" for searchFields.

How to configure

Please see this Video for a walkthrough of the setup:

https://www.loom.com/share/51669e9cea324405885bc3c8ca07d65c?sid=0de42c40-e066-4d40-8cc7-94b541a30c84 Use this Catalog-API query (adjust appId, preview and search term to match the ACFs content)

Example setup (making image titles searchable)

  • Login to the Hub as Admin
  • Navigate to ACF > Field Groups > Create a new field group OR edit an existing field group
  • Create the following items
    • a) an ACF field with type "image" and type in "title" in field "Index fields"
    • b) an ACF field with type checkbox (fill out available checkboxes in "choices" field, e.g. 'checkbox 1 : Value 1'). Then type in "checkbox_feld" in field "Index fields"
  • Save your changes
  • Create an article, scroll down and find the image ACF field
  • a) upload an image and check the title of the image in the media library (e.g.: apple) b) search for the created checkbox field and hit the checkbox
  • Publish the article
  • a) hit the query with search term "apple" b) hit the query with search term "checkbox 1" -> query shows exactly 1 post as result