Skip Navigation

[Resolved] Search using a repeatable field group

This support ticket is created 3 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#2089903

Hello,

I have built a custom search on a page and I would like to be able to search by the custom posts repeatable group selections. The following page includes all Physician posts:

hidden link

within the physician selection you can select specialty and language using a repeatable field group. I added the fields to the search form however it does not filter the physicians based on their selected language or specialty. Is there a way to search within repeatable field groups and also is there a way to include the repeatable field groups as part of the text search as well?

Thanks,
Claudia

#2090295

Hi Claudia,

Thank you for contacting us and I'd be happy to assist.

The way search filters work in Toolset views, only custom fields and taxonomies directly attached to the post type, can be used.

As the fields in a repeatable field group are stored with a different hidden post type, you'll not be able to use them for the view that shows the Physician posts.

A better approach, would be to register two new custom taxonomies for the Physician post type:

1. Specialities
2. Languages

This will not only allow you to search by specialities and languages in the view of the Physicians, but will also result in better performance.

To extend the text search to also include the text from custom fields and taxonomy terms, you'll need a third-party plugin "Relevanssi":
https://wordpress.org/plugins/relevanssi/

We have a guide on the topic in the context of using it for the custom fields, but the similar steps can be used for the taxonomy terms as well:
https://toolset.com/course-lesson/searching-texts-in-custom-fields-with-toolset-and-relevanssi/

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar