Skip Navigation

[Resolved] Change page for custom search results

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 11 replies, has 2 voices.

Last updated by jamesR-13 1 year, 8 months ago.

Assisted by: Shane.

Author
Posts
#2414053

I have created a custom search. I want to display the results on a separate page.

I get a 404 when I do a search on the front end. (hidden link)

How do I tell the search what page to use to display the results?

#2414095

Shane
Supporter

Languages: English (English )

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

Hi James,

Thank you for getting in touch.

To add the search bar only to a page you will need to use the shortcode below.

[wpv-form-view name="search-the-projects" target_id="1485"]

You will need to change "search-the-projects" to the slug of your actual search view. Then change the target_id value to the ID of the page that you want the search results to be on.

If you want the results only on the results page then you will add.

[wpv-view name="search-view" view_display="layout"]

Of course change "search-view" to the slug of your view.

Please let me know if this helps.
Thanks,
Shane

#2415613

Shane, I unfortunately haven't had a chance to try this solution out, but I believe it will do what I need it to do.

#2415651

Shane
Supporter

Languages: English (English )

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

Hi James,

Once you get a chance to try the solution you can let me know but this should resolve the issue you're having.

Thanks,
Shane

#2417051

I got the results showing on the other page, but I seem to be getting results that don't match the search input. Can you help me figure out why that it, please?

Thank you!

#2417109

Shane
Supporter

Languages: English (English )

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

Hi James,

Would you mind allowing me to have admin access to the website so that I can have a more detailed look at this for you ?

Please where applicable please provide me with a link to an example page where I can see the issue.

I've enabled the private fields for your next response.

Thanks,
Shane

#2417625

Shane
Supporter

Languages: English (English )

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

Hi James,

I did a test on this and the search seems to be working fine.

Here is an example.
hidden link

Thanks,
Shane

#2417675

If i search for a single specific business by name, yes, it seems to only return that result. But if I search by a category, i.e. 'pizza' or 'vet' it returns lots of results that do not match. Examples:

hidden link

hidden link

The first few results seem to match, but then it has a lot more that do not.

#2417753

Shane
Supporter

Languages: English (English )

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

Hi james,

The view search will only search through the Post Title, Post Content and Custom Fields.

Given that you've mentioned the taxonomy, then this won't be included as a searchable term. You will need to use a filter for the taxonomy.

Thanks,
Shane

#2418189

OK, so then why when I search for "pizza" do i get results such as "Digital Prestidigitation" and "Prairie Home LLC". Neither of those includes anything about pizza in any of the specified fields.

#2418267

Shane
Supporter

Languages: English (English )

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

Hi James,

It appears the issue is being caused by relevanssi and the indexing of the custom fields. I'm not sure how relevanssi is matching the custom field data with the search but the issue is stemming from here.

Are there any particular custom fields that you want to be included in the text search ? As you can set the search to only include the post title and post content.

Please let me know.
Thanks,
Shane

#2418291

I disabled partial word matching in relevanssi.

My issue is resolved now. Thank you!

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