Skip Navigation

[Resolved] Relevanssi doesn’t include custom fields in text search

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

Problem: I am using a text search box to search for posts. I would like to index custom field values using Relevanssi, but they don't seem to be working.

Solution: Make sure the text search Query Filter is set up to search through custom fields, and check to be sure the custom field is set up to be indexed in Relevanssi. Rebuild the index.

Relevant Documentation:
https://toolset.com/documentation/user-guides/searching-texts-custom-fields-views-relevanssi/

100% of people find this useful.

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

This topic contains 10 replies, has 2 voices.

Last updated by Ido Angel 6 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1092280

Hey,

Take a look here:

hidden link

This is a custom search for the word "פאיוטו" in hebrew (the name of some guy who wrote books).
The results show only 3 posts, even though there are many more posts with this word appearing in a custom field, wpcf-author. this field is supposed to be indexed - i've added this to the relevanssi custom field box:

wpcf-web-blog, wpcf-audio, wpcf-video, wpcf-subtitle, wpcf-buy-link, wpcf-author, wpcf-publisher, wpcf-translator, wpcf-publication-year, wpcf-language, wpcf-description, wpcf-magazine-article-date

for example, here's an article with the word in a custom field:

hidden link

the name appears there like this: "פ.א.פאיוטו" and not the pure "פאיוטו" (in english, it's like it's appearing "p.a.paioto" instead of just "paioto". when i search for "פ.א.פאיוטו" i get 0 results:

hidden link

which means it doesn't register the custom field at all.

i've tried playing the relevanssi punctuation settings, but that didn't change anything.

Thanks!

#1092396

Hi, please go to wp-admin > Settings > Relevanssi > Indexing tab, and check to be sure this post type is included in the index. Also check to be sure the post type is not "excluded from search". Then go to the "Searching" tab and check the "Keyword matching" settings. This setting should be "Partial words". "Partial words if no hits for whole words" will not work if any results match the whole word.

Rebuild the index if necessary, and test again. Let me know if the problem is not resolved.

#1092497

hey,
done everything - still the same problem:

hidden link

#1093149

Okay a few more troubleshooting steps:
- Please edit this View and expand the Post Search Query Filter. Check to be sure custom fields are included in the search options. If you cannot see the Query Filter, scroll to the top right corner of the screen and click "Screen Options". You can enable the Query Filter panel here.
- Edit the Post Field Group that contains the wpcf-author field. Expand the wpcf-author field panel and check to be sure the "Include this field in text searches throughout the site" checkbox is checked.
- Rebuild the index and test again.

If the problem is still not resolved, I'll need to take a closer look. Please provide login credentials in the private reply fields here.

#1093890
Screen Shot 2018-08-28 at 9.27.34 AM.png

well - the search filter query doesn't include the custom field - it's a text search box, and text search is "relevanssi". i don't want any filters there, just a text search box.
When you add a text search box in the Search and Pagination editor, a corresponding Query Filter is added automatically - both are actually required in this case. I'm attaching a screenshot showing that here so you can see what I'm describing. There is a configuration setting in the Query Filter that lets you choose where to search, and you must select the option that includes custom fields.

#1093994

perfect. that wat it! i wasn't aware of that section.
cheers!

#1094052

hmm ok - it works, but now it down;'t show the post count.
i have this code which used to work before the fix:

[wpv-control-post-taxonomy taxonomy="post-typer" type="radio" format="%%NAME%% <span class='orange'>(%%COUNT%%)</span>" orderby="none" url_param="wpv-post-typer"]

i tried rebuilding the index but to no avail...

thanks!

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/taxonomy-term-filter-post-counts-are-all-showing-0/

#1094058

Let's address the post count issue in another ticket.

#1094071

ok, if you insists 🙂 although it's directly related:

with your solution, the count doesn't show. when i switch back to searching only title and body, the count shows.

open a new one?

#1094079
#1094093

Thx m8