Hi,
I'm trying to use Relevanssi to search through a custom field that is inside a repetable group. Is is posible?
I checked both the post types and pasted the custom field in the Relevanssi settings page, but it doesn't seem to be working. I'm starting to think it's because it's inside a repetable group.
Kind regards
Hi,
Thank you for contacting us and I'd be happy to assist.
The custom fields inside the repeatable field groups can be indexed by Relevanssi, but, it is important that the view is set to show those repeatable field group posts, through the post-selection settings.
At the core, the repeatable field group posts are stored in a separate post type that has one-to-many post-relationship with the parent post type.
For this reason, if the view is set to show the results from only the parent post type (and not the child repeating field group posts), their results won't be included in the results either.
You'll find a good explanation about the same in this reply from Nigel:
https://toolset.com/forums/topic/repeatable-group-field-in-relevanssi-search/
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
I'm not sure if I follow.
I'm not using any views, but the regular wordpress search form. My custom field a single line type of field, inside a repetable group, and in the relavanssi Indexing settings both post types are checked and custom fields are set to all.
Thanks for your help
Thank you for waiting while I performed some tests on my website.
I was able to make the custom field from a repeatable field group indexed for search results, with the following steps:
1. I added custom post type "Books" which also had a repeating field group named "Book RFG". In this group, I added a single line type field "book-rfg-field".
2. From WP Admin -> Relevanssi -> Indexing, I selected "book" and "book-rfg" 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 slug with prefix "wpcf-" so that is became "wpcf-book-rfg-field".
Screenshot: hidden link
3. The repeatable field group post types (in this case "book-rfg"), 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.
After that, I recreated the search index from WP Admin -> Relevanssi -> Indexing, and then when I performed the search using the regular WordPress search, it included the results based on that custom field value.