Skip Navigation

[Résolu] relevanssi prevents from ordering by custom field

This support ticket is created Il y a 1 an et 6 mois. 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/Karachi (GMT+05:00)

This topic contains 4 réponses, has 3 voix.

Last updated by Ido Angel Il y a 1 an et 6 mois.

Assisted by: Waqar.

Auteur
Publications
#2458025

Hi,
I have relevanssi installed for being able to search within custom fields, and I need that for certain post types. But in some post types I would like to order results by a custom date field, and I can't when I'm using relevanssi. Is there a function to allow only chosen views to ignore ordering by relevance?

Thanks!

#2458431

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

In the Relevanssi settings you specify what to include in the index.

If you update the index settings to exclude the post types in question (and rebuild the index), does that not mean Relevanssi is ignored when it comes to ordering?

(I haven't tested that, but it is what I would expect.)

#2458631

Hey Nigel,
Basically you're right, but I need to be able to search in custom fields as well with these post types, so I have to index them in relevanssi... question is can they be index and still ordered by the custom field and not relevance.
Cheers
Ido

#2458957

Waqar
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Ido,

If you'll go to WP Admin -> Settings -> Relevanssi and switch to the "Searching" tab, you'll see some options to fine-tune its behavior for the search results.

There is also a "Default order" setting, but it only offers "Relevance" or "Post date", options.

When the Relevanssi is active it takes control over the WordPress queries, as a whole. So it would be a good idea to get in touch with their support team, to know if they offer any function/hook, to exclude certain pages or queries so that certain views can be ordered by the view's settings.

regards,
Waqar

#2458959

Gotcha
Thanks Waqar

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