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
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