Skip Navigation

[Resuelto] relevanssi prevents from ordering by custom field

This support ticket is created hace 2 años, 2 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 4 respuestas, tiene 3 mensajes.

Última actualización por Ido Angel hace 2 años, 2 meses.

Asistido por: Waqar.

Autor
Mensajes
#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

Idiomas: Inglés (English ) Español (Español )

Zona horaria: 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

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