Skip Navigation

[Gelöst] Sort by relevance

This support ticket is created vor 3 Jahre, 6 Monate. 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
- 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 3 Antworten, has 2 Stimmen.

Last updated by Luo Yang vor 3 Jahre, 6 Monate.

Assisted by: Luo Yang.

Author
Artikel
#1787675

I would like to sort results by relevance. I have custom code that is used to display relevance as a percentage, and I would like to use that relevance value to sort the results in a View.

#1788465

Hello,

There isn't such kind of built-in feature within Toolset Views/Blocks plugin, Toolset Views plugin is using WP_Query to query posts, see WP document:
https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters

There isn't such an option to sort the result by relevance,

You might consider custom codes, for example, use filter hook "wpv_filter_query_post_process" to resort View's result with custom codes, see our document:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query_post_process
When displaying a View listing posts, this filter is applied after the WP_Query has been run.

#1788691

hey Luo,
thanks but I don't have enough php skills to deal with that.
If it's a simple code - I'd appreciate your (or Waqar's) help
if it's too much, i'll give it up
Ido

#1789769

According to our support policy, we don't provide custom codes support
https://toolset.com/toolset-support-policy/
you can also check it with our Toolset certified consultants:
https://toolset.com/contractors/

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