Skip Navigation

[Resolved] Text search does not work with Relevanssi any more when used in a View.

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

Problem:

I am using the plug-in Relevanssi to be able to do a text search in custom fields. It works very well when I use it with the standard/native WordPress search where the query string is:?s=searchterm

However, when I create a View with a text search, the search only works with the post title and post content. It does not work with any custom field.

Solution:

In the post view, the filter should be this:

Filter post title, content and fields by a text search that will be added manually using the shortcode [wpv-filter-search-box].

Relevant Documentation:

https://toolset.com/documentation/user-guides/searching-texts-custom-fields-views-relevanssi/#including-custom-fields-in-the-search

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Amr 5 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1285581

Amr
Screen Shot 2019-07-06 at 8.11.37 PM.png
Screen Shot 2019-07-06 at 10.58.22 AM.png
Screen Shot 2019-07-06 at 7.51.32 PM.png

I am using the plug-in Relevanssi to be able to do a text search in custom fields. It works very well when I use it with the standard/native WordPress search where the query string is:?s=searchterm

However, when I create a View with a text search, the search only works with the post title and post content. It does not work with any custom field.

Everything is configured properly in the Relevanssi setting. See attached. The custom field wpcf-context is set properly.

#1285889
relevanssi1.JPG

Hello,

In your screenshot:
hidden link

section "Query Filter", the filter should be this:
Filter post title, content and fields by a text search that will be added manually using the shortcode [wpv-filter-search-box].

Please edit it, make sure you are using option "Title, body and custom fields", see screenshot: relevanssi1.JPG

More help:
https://toolset.com/documentation/user-guides/searching-texts-custom-fields-views-relevanssi/#including-custom-fields-in-the-search

#1285925

Amr

My issue is resolved now. Thank you!