Problem:
I want to have a search function on the home page of my website, like Google's search box. This search will only deliver back results for pages under the custom post type 'Therapies for ...'.
So a client lands on my website on the home page (or if I choose to put this on other pages, and then they can search for help for a specific 'issue' which might be 'anxiety' or it might be 'panic' or it might be bereavement or one of a few hundred issues that I have or will have written CPT for.
Now at the moment I have created a trial search function on the following page:
https://atherapistnearby.co.uk/search-view/
now you will see that there is both a drop down box which pulls all the pages I have currently written in the CPT 'Therapies for' but eventually there will be a few hundred there and this is both 'too many' to have a drop down for but also it is much easier for a client to search for 'Therapy for an affair' and get back say a 3 results that might be relevant.
However at the moment the client has to be very exact in what they type into the search box as the search only pulls exact matches. If a client put in therapy to recover from someone cheating on me ... there is no result returned.
I want to be able to tag individual CPT pages for the 'Therapies for' CPT with relevant 'tags' so that if a client searches for 'affairs' or 'betrayal' or 'infidelity' or 'Cheating' then the page on 'affairs will be returned.
Is there any documentation that you are following?
I have successfully created the search following your lessons
Is there a similar example that we can see?
not that I've found but like I said I want it to be a simple search box that looks at say the 'title' or 'tags' and delivers back results if one or more of the words entered int he search box is searched for.
Solution:
In this case, what might work for you is the integration between Toolset and the plugin Relevanssi: https://toolset.com/course-lesson/searching-texts-in-custom-fields-with-toolset-and-relevanssi/
In this scenario, I’m afraid that it is the best workaround we can offer. For example, you could create some custom fields that would be responsible for the keywords you have mentioned, and then index those fields with the Relevanssi plugin, in order to make a search based on them.