Skip Navigation

[Resolved] improving search results

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

Last updated by Luo Yang 4 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#2000811

Tell us what you are trying to do?
Trying to implement the Relevanssi plugin. I want to improve the search results. If I do a search for an exact match title, I'm expecting for it to be the first result, not 30th, in the search results

I have a filter that allows the experience to toggle between post types using this shortcode

[wpv-control url_param="wpv-post-type" type="select" values="product,post" display_values="Book Search,Story Search" auto_fill_default="product"]

Is there any documentation that you are following?
I followed both of these instructions, neither worked
https://toolset.com/course-lesson/searching-texts-in-custom-fields-with-toolset-and-relevanssi/
hidden link

Is there a similar example that we can see?
N/A

What is the link to your site?
N/A, local site

#2000813

To capture all searches, I have the below code implemented in order to redirect to the Page I created with the custom View to show the results.

function wp_change_search_url() {
if ( is_search() && ! empty( $_GET[ 's' ] ) ) {
wp_redirect( home_url( "/search/?wpv_post_search=" ) . urlencode( get_query_var( 's' ) ) );
exit();
}
}

add_action( 'template_redirect', 'wp_change_search_url' );

#2001385

Hello,

I think there is a misunderstanding, the Relevanssi plugin will take over the WordPress search result query, Toolset WordPress Archive can only customize the style/format the WordPress search result page.

In your case, you might consider custom codes, I have searched it in google, and find some related threads, for example:
hidden link

For your reference.

#2002087

Hi Luo,

Thank you for the response.

So I created a page called Search, and it lives at /search/

Then I created a Toolset View inside of the Search Page to render the results.

Are you stating that this it not the correct method to render search results through Toolset Views?

#2003901

No, since you are going to customize the query of WordPress search result page with Relevanssi plugin, the WordPress search result page is an archive page, so I don't think it is good idea to setup another page for it.

As I mentioned above, there isn't such kind of built-in feature within Toolset plugins, it depends on Relevanssi plugin, and it needs custom codes, please try the solution provided by relevanssi.com:
hidden link