I'm trying to filter a custom post type (Projects) using a text-based search field. I would like the filter to look at the relationship fields of the Project. In this case, a Project custom post type has a many to many relationship with the custom post type People.
For example, on hidden link, if someone searches "John", all the Projects that have a relationship with John should show up in the search results.
Is this possible? If not, is there an alternative solution?
Thanks,
Austin
Hi Austin,
Thank you for contacting us and I'd be happy to assist.
At the moment, post-relationships are not covered in text-based search filters in post views, but you're welcome to submit this as a feature request:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
The post-relationship search filters work in form of a select type field, as explained in this guide:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/how-to-filter-posts-by-their-ancestors/
One workaround can be to store the title of the related posts, in a single line type custom field. After that, you'll be able to use the "Relevanssi" plugin to extend the default text-based search feature to also include the values from that custom field:
https://toolset.com/documentation/user-guides/views/searching-texts-custom-fields-views-relevanssi/
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
My issue is resolved now. Thank you!