I have a specific search requirement which searches custom posts with custom fields and returns post_authors as a result.
Let’s say I have two custom post types house_post and car_post. A user can have multiple houses and cars. I want to build a global user search which can search in custom fields of house_post and car_post and return me the author list who are having the posts which matches search criteria.
Does anyone have idea about how I can achieve this. I have tried it using relevanssi and facetwp plugin. But there are following problems.
It is returning posts as result, but I want post_author as result.
For multiple facets both criterias should be in same posts only then the post appears in the search result. e.g. I have filter for house_type and car_type. If I select house_type = ‘2bhk’ and car_type = ‘SUV’ then it tries to search both filters in same post. But it never possible that both custom fields found in same post as they are in different posts. I want post authors matching the search not the posts.
I also want to include BuddyPress xprofile fields in search criteria.
Read more here:: Search custom post with custom fields by post author