121 Posts
deralex
7 years ago
4
Topic

Hi,

I try to build a search form like "picture 1 not empty or picture 2 not empty". So solve it I use a search query field with a cck storage location field as shown here http://www.seblod.com/resources/tutorials/using-the-search-query-field-plugin . Works fine.

Also the user should get additional search fields. Together with standard cck search, the additional search fields work. When using the search query field, the additional fields don't work no more.

How can I combine a search query field with other fields?

Get a VIP membership
4229 Posts
Kadministrator
7 years ago
3
Level 1

You can either:

a) use syntax like [MATCH]database_field_name||$uri->getValue('search_field_name')[/MATCH] e.g. [MATCH]title||$uri->getValue('seb_keywords')[/MATCH] - this will use your set matching for this field or you can use just $uri->getValue('search_field_name') e.g. WHERE some_db_field=$uri->getValue('search_field_name'), both alter your custom query based on search fields values

b) use append mode, here your query will be appended to the existing query constructed by seblod search

4229 Posts
Kadministrator
7 years ago
2
Level 2

I amended the tutorial

121 Posts
deralex
7 years ago
0
Level 3

Thank you, Klas!

My search form and item view are pretty complex. So both ways are not very handy:

--> a) I have to build a huge query with all the fields. Adding a field to the item view means changing the search query.

--> b) I can append SELECT, GROUP BY and HAVING. Nice features. What I need is appending WHERE. There's no way to do that, right?

121 Posts
deralex
7 years ago
0
Level 3

Thank you, Klas!

My search form and item view are pretty complex. So both ways are not very handy:

--> a) I have to build a huge query with all the fields. Adding a field to the item view means changing the search query.

--> b) I can append SELECT, GROUP BY and HAVING. Nice features. What I need is appending WHERE. There's no way to do that, right?

Get a Book for SEBLOD