Skip Navigation

[Resolved] Text search only matching on title not working

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

Problem: I would like to search posts by title only, but it doesn't seem to be working with Relevanssi.

Solution: Remove the custom code that is breaking search queries.

This support ticket is created 3 years, 10 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

This topic contains 7 replies, has 3 voices.

Last updated by jamesR-13 3 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1905823

I'm trying to setup a text search that includes all custom fields. All fields are single line text fields.

I have added the fields manually to the relevanssi settings, as well as selecting the 'All" option for which fields to index, and I have rebuilt the index numerous times.

I have ensured that the Post search filter is set to include custom fields.
(note: if I set the post search filter to content and title, it will return matching titles, but if I set it to include fields, it doesn't even appear to do the search.

I have followed the instructions here:
hidden link
and I can see that relevanssi is indeed picking up the correct fields and values.

But text search only works on the title. Please advise.

#1906307

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi James

It sounds like you are doing the right things, but it would help if we could access your site to see for ourselves and to verify how you have this set up.

Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.

Where can we find the search View?

Do you have an example of a search to test with, and which results should be returned?

#1906629

It appears this isn't private...

#1906711

Hi, sorry for the confusion. I've activated private reply fields here for your next response.

#1906837

I'm seeing an error when I try to log in using these credentials. Can you double-check the password for me? I also tried using the same login from another ticket, but got the same error message:

https://toolset.com/forums/topic/update-parent-post-author-when-creating-or-editing-child-post/

#1906897

I'm really batting 1000 today, aren't i?

Try again please. Same credentials. This is a different site from that other ticket.

#1906999

It looks like there's some code in your child theme that is dumping some relevanssi parameters and then exiting, which breaks the View query:

add_filter( 'relevanssi_modify_wp_query', 'rlv_check_parameters' );
function rlv_check_parameters( $query ) {
    var_dump( $query->query_vars );
    exit();
}

That's why the search doesn't appear to function correctly. This code looks like it was used for testing, but never removed. I think this code should be removed or commented out if you're not actively testing things.

#1907025

My issue is resolved now. Thank you!