Skip Navigation

[Resolved] I can only search exact match. How do I display results of a partial match?

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

Problem: I would like to find partial search matches in a text search, but right now I only find exact matches.

Solution: Use the "like" operator in your Query Filter instead of "equals" to find similar results.

Relevant Documentation:
https://toolset.com/documentation/user-guides/front-page-filters/

This support ticket is created 6 years, 7 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 4 replies, has 2 voices.

Last updated by johnC-34 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#918373

I am trying to: Display results of a search using a partial entry.
For example, I have two companies in my database:
Albertsons
Albertsons Express
I would like to be able to enter 'Albertsons' in the search field for Company name and display all results that include 'Albertsons' in the company name. Currently, I will show no results unless I type in an exact match in the Company Name field, and if I just type 'Albertsons' I only get the exact match result. How can I display results that are not an exact match, but include the value?

Link to a page where the issue can be seen:
hidden link

I searched:
'Albertsons'

I expected to see:
Albertsons
Albertsons Express

Instead, I got:
Albertsons

#918420
Screen Shot 2018-06-27 at 11.30.25 AM.png
Screen Shot 2018-06-27 at 11.30.45 AM.png

Hi, in the Query Filter you can choose the operator "like" instead of "equal" for your comparison criteria. I'm attaching two screenshots that show how you can set this up when creating the filter, or when editing an existing filter. Let me know if this doesn't work for what you want to achieve.

#918978

Where do I find the query filter screens you show above?

#919001

In the View editor page in wp-admin, you should be able to find the Query Filter panel near the top of the page. That's the screenshot from 11.30.45 AM. If you cannot see it, it's hidden because of the settings that were chosen when the View was created. You can enable the Query Filter panel in that case by scrolling to the top right corner of the admin page and clicking "Screen Options". Then you will see a config editor where you can enable or disable different panels, including the Query Filter.

The other screenshot (11.30.25 AM.png) is from the filter editor that appears when you insert a new filter in the Search and Pagination panel of the View editor screen.

#919083

That worked. Thanks!