I want to use the classic wpv-filter-search-box within a classic wordpress archive to allow users to find what they are looking for. I have a few - also nested - repeating field groups with reveral repeating fields. Unfortunately I'm not be able to extend the search to this repeating fields groups. I understand that repeating field groups are different (child) post types which are connected to the parent post types. I followed this topics: https://toolset.com/forums/topic/relevanssi-repeatable-custom-field/ https://toolset.com/forums/topic/repeatable-group-field-in-relevanssi-search/
to find a solution for me, but unfortunately I still get no results (parent posts) which contains the repeating field search terms.
I already did this: From WP Admin -> Relevanssi -> Indexing, I selected the repeating field group post types and also selected "some" for the custom fields option, so that individual custom fields can be included in the indexing. In the field for the custom fields, I added the field slugs with prefix "wpcf-". The repeatable field group post types are set to be excluded from the search results, by default. To overcome this, I unchecked the option "Respect exclude_from_search" from WP Admin -> Relevanssi -> Searching.
Hello. Thank you for contacting the Toolset support.
Have you set your view to query the repeating field group? if yes, Can you please share problem URL where you added the view as well as admin access details and on what fields you want to add the Relevanssi search?
The thing is that within the archive we do not support the repeating field group search or nor using views.
The reason is repeating field groups are managed as child post type and technically the view/archive should be set to search to specific post type (where repeating field group internally treated as the child post type and to search within the repeating field group field you will require another view).
Archive meaning is to search within the specific post type archive we can not attach there another post type.
Another workaround would be to create a view and that view should be set to query the profile post type and you should create a page and add this view to that page. But as you are using the relevanssi, once you perform the search the search query will be handled by relevanssi not Toolet, we are just passing the search params to relevanssi hense I do not thing we will modify the search query to include the repeating field group post type.
All in all, we do not advise and its not natively possible as It's a limitation that you can not build a custom search that should search in parent and child post type at a time.
Hi Minesh, thanks for checking out! To be honest, I am very surprised by your answer. Because it means that we can't create a reasonable search with toolset. It is definitely a blatant limitation of repeating field groups. I wonder why this issue has never been addressed by anyone else or how others have solved it. Ist this such a special case?
If I understood you correctly, there are only two ways now: to build a page that contains a view and search with the normal wordpress search (and not Relevanssi). Or to work without repeating field groups and try to store the information in the normal post type. Is this correct? Are you quite sure, that there is no other solution?
(Frankly, our whole project is on the back burner right now and over a year of work).
If I understood you correctly, there are only two ways now: to build a page that contains a view and search with the normal wordpress search (and not Relevanssi).
==>
You need to build a page that contains a view including the search with relevanssi and you may need to use the pre_get_posts hook or any other hook belongs to relevanssi that should be triggered before search query is fired to fetch all posts with the search keyword and based on the found repeating field group posts we need to return the parent posts. Also you will have to set your view's search settings to use the URL param rather AJAX as to search Within the repeating field group fields we may require to get search keyword from URL param.
Or to work without repeating field groups and try to store the information in the normal post type. Is this correct?
==>
If you store all content to normal post type, then it will be really easy and in that case you do not have to create another page and post, as all custom fields belongs directly to post that you set to query the archive you can easily build custom search.