Skip Navigation

[Resolved] Searching keywords from repeating field group is not working

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to be able to use text search to find posts using information stored in repeatable field groups. However, when I add RFGs to the index I see links in the search results that point to an invalid post. I would like to link to the post containing the RFG.

Solution: Add the repeatable field group to the search index, then use a WordPress Archive to display the search results. Use conditional HTML in the archive to determine if the link is for a RFG post type, and display a link to the parent post instead. Something like this:

[wpv-conditional if="( '[wpv-post-type]' eq 'custom-page-section' )"]
[wpv-post-link item="@custom-page-section.parent"]
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-type]' eq 'custom-post-section' )"]
[wpv-post-link item="@custom-post-section.parent"]
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-type]' ne 'custom-page-section' ) AND ( '[wpv-post-type]' ne 'custom-post-section' )"]
[wpv-post-link]
[/wpv-conditional]

Relevant Documentation:
https://toolset.com/documentation/user-guides/searching-texts-custom-fields-views-relevanssi/
https://toolset.com/documentation/getting-started-with-toolset/customize-post-archives/

This support ticket is created 5 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 28 replies, has 3 voices.

Last updated by eddieW-2 5 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1136588

Dear Support,

I am trying to search keywords from repeating fields groups that I have placed on my pages. However, each result links me to the home page instead of the page that contains the repeating field group.

Kindly assist on this matter.

Thank you.

#1136857

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eddie,

Thank you for contacting our support forum.

Are you creating the search with our views plugin ? Also do you have the relevanssi plugin installed?

Please let me know.

Thanks,
Shane

#1137071
Relevanssi-1.jpg
Relevanssi-2.jpg

Hi Shane,

No I am not using the views plugin. I am just using the default search form template that comes with WordPress.

And yes, I have installed the relevanssi plugin.

Kindly find the screenshots below for your reference as they contain the settings we used for the relevanssi plugin.

Thank you.

#1137635

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eddie,

What about when you type a text that is just in a regular field group , not a repeated field group.

Does the issue still occur then ?

Please let me know.

Thanks,
Shane

#1138068

Hi Shane,

It seems like the issue still persists with regular custom field.

#1138384

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eddie,

Could you have a look at the Relevanssi documentation here
hidden link

There should be an option to allow for the indexing of the custom fields.

Thanks,
Shane

#1138421

Hi Shane,

While I can see the search results appear when I search for a certain phrase/word, but the link of the post is leading me to something similar as below:

DOMAIN.COM/custom-post-section/rfg-6/

The custom-post-section being the RFG slug and when I click on it, it just redirects me to the homepage.

#1139031

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eddie,

I see what you mean.

So the problem is the repeatable field groups are created as custom post types, in a post relationship related to the parent CPT.

It seems what is happening here is that the url for the RFG which is normally hidden and meant for our internal use only is being displayed.

Could you provide me with an example phrase to search for so that I can raise this issue with out team ?

Thanks,
Shane

#1141942
Screenshot_4.png
Screenshot_3.png
Screenshot_2.png
Screenshot_1.png

Hi Shane,

Sorry for the late reply, below is the link for my website
hidden link

For first example,
You may try it out by searching the keyword 'bathroom' on the burger menu and the search result that came up with the post link are still including the repeating field group url. This is using repeating field group.

For second example,
You may refer to this link
hidden link

The text 'honed' is generated using regular custom field, but when i search the keyword 'honed', the search result shows no result.

#1142503

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eddie,

So I test this out and the link does generate a link to an RFG but when I clicked the link it redirects me to the homepage.

The RFG is something that we can look at but with the honed Custom field not showing up in the search result.

What you can do is to allow me to have a look at this through the backend .

The private fields will enabled for your next response.

Thanks,
Shane

#1143999

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eddie,

Thank you for the credentials.

I was able to log in and test the issue. However for me to report this to our development team for further debugging I would need to take a copy of the site to test here locally.

Would you mind if I took a copy of this site using the duplicator plugin ?

Thanks,
Shane

#1144412

Hi Shane,

You may copy the site and test it out. Thank You.

#1146064

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eddie,

I've created the copy of the site and will report with any updates.

Thanks,
Shane

#1146696

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eddie,

I was digging into your site trying to find where the Bathroom Experience text is generating from in the search.

However I was not able to find it. Perhaps you have an idea where I can find this?

Thanks,
Shane

#1147074

Hi Shane,

You can find the Bathroom Experience under custom post type called Ideas with the post named Bathroom. Thank you.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.