Saltar navegación

[Resuelto] Setting up custom search

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

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Este tema contiene 6 respuestas, tiene 2 mensajes.

Última actualización por PawelS4412 hace 5 años, 7 meses.

Asistido por: Nigel.

Autor
Mensajes
#1242925

Tell us what you are trying to do?
I am trying to set up custom search, and wondering is it possible to set up search to search throug 5 or 10 different custom fields?

Is there any documentation that you are following?
I saw old tickets that this is not possible but they are quite old so I thought I ask.

#1243019

Nigel
Supporter

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

Zona horaria: Europe/London (GMT+00:00)

Hi there

I don't see why this wouldn't be possible.

You make a custom post type and add custom fields and/or taxonomies for size, shape, color, priority, availability, popularity and generate some posts with these fields or taxonomies.

You create a custom search View and insert filter controls for each of these fields.

Do I misunderstand what you are aiming to do? No reason why that wouldn't work.

Did you try?

#1243021

I am sorry for not writing the ticket in simple understandable way. I will try againg. Example:

I have:
Custom field1
CF2
CF3
CF4
CF5

Can I make one search (one condition) that will gone search throug custom fields 1 to 5?

#1243044

Nigel
Supporter

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

Zona horaria: Europe/London (GMT+00:00)

I'm still not sure I understand.

Are you talking about conditional display based upon custom field values as described in the documentation: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

You can set up multiple conditions using the "Add another condition" button.

Or do you mean something else?

#1243069

Ok, so:

I set just one consultant area of specialisation in one fild:
CF1: Children therapy
CF2: Famili therapy
CF3: Couple therapy
CF4: Hazards
CF5: Online therapy

Someone is typing in search bar: Hazards, and the result appears. Please let me know am I understandable now. As far as I understand the same topic was mentioned here: https://toolset.com/forums/topic/search-multiple-fields-using-one-text-box/

#1243087

Nigel
Supporter

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

Zona horaria: Europe/London (GMT+00:00)

OK, you want a View with filters for several custom fields and to use a single text filter control to provide the value for all of the filters.

That's not possible as described, no, each filter would need its own control.

But, if you add Relevanssi to your site you can create a text search View and in the settings for Relevanssi you would have it index all of the relevant custom fields.

So you have a View with a text search where not only the title and post content are included in the search, but your custom fields as well.

I think this is the closest to what you are aiming for.

See https://toolset.com/documentation/user-guides/searching-texts-custom-fields-views-relevanssi/

#1243088

My issue is resolved now. Thank you! 🙂