7 Posts
aktinon
10 years ago
10
Topic

Hello,

it's possible to change a AND to a OR in the search of 2 dynamic fields/option fields?

The Search Operator doesn't work for me for that.

Query:

... AND t1.catid LIKE '%47%' AND ((t2.ral_module LIKE '%171%')) AND ((t2.ral_module LIKE '%176%')) GROUP BY t0.pk

ORDER BY t1.title ASC

Get a Book for SEBLOD
4229 Posts
Kadministrator
10 years ago
3
Level 1
7 Posts
aktinon
10 years ago
2
Level 2

I tried to use the search operator, but it inserts not the right Code in my query.

Is there a other way to change the query?

4229 Posts
Kadministrator
10 years ago
1
Level 3

It shoudl insert the righjt code, what does it do for you? You need to palce it before the right field, in your case before second dynamic field.

7 Posts
aktinon
10 years ago
0
Level 4

Yes,

dynamic field
OR field
dynamic field

This inserts an AND before GROUP and breaks the query. If I uses parentheses it inserts more ANDs before GROUP, AND AND AND GROUP

My suggestion is that the search operator won't work with the match "any words"

You have an error in your SQL syntax ...

... AND t1.catid LIKE '%47%' AND GROUP BY t0.pk ORDER BY t1.title ASC

4229 Posts
Kadministrator
10 years ago
0
Level 1

Seems there is a bug with multiples matching, I had similar problem on category search with Not in

10 years ago
1
Level 1

Hi Aktinon,

Do you try to change the match on your fields with something like "any words exact"?

Thanks.

7 Posts
aktinon
10 years ago
0
Level 2

Yes, but doesn't change the problem.

I also think there is a bug with multiples matching.

10 years ago
0
Level 1

Hi aktinon,

Before you talk about a bug, please ensure if there is really a bug.

Can you share with us the configuration of your search form? We need to know which field you use in the search form and which field you use in the site form to add article.

Based on the existing posts, I think you use a "select dynamic" field and its copy in the search form in order to retrieve all articles which have values 171 and 176.
I think you have a unique "select dynamic" field in the site form view of the content type you use.

My suggestion:

  1. try to use only one "select dynamic" field in the search form view of your search type.
  2. click on button "2" and fill value 171,176 in the live value column of the select dynamic field
  3. click on button "3" and select option "any word exact". Click on button "+" to add separator "," (comma)

I hope this response help you to solve your issue.

Regards,
Mehdi.

7 Posts
aktinon
10 years ago
1
Level 1

We  need and use the combination of 2 dynamic select fields and for the where clause "any words".

The life value for both is the set to variable and multiple.

I can setup a virtual server with a copy of the website to see more.

10 years ago
0
Level 2

Hi aktinon,

You said "3 days ago 0 Level 1 We need and use the combination of 2 dynamic select fields and for the where clause "any words"" OK. But, when i check the query resulted from your search type i read 

"((t2.ral_module LIKE '%171%')) AND ((t2.ral_module LIKE '%176%'))".

For us, that's means you use 2 fields "select dynamic" with the same storage. Why? Because the query generates 

"t2.ral_module LIKE .... AND ... t2.ral_module LIKE...

In this case, you should use only one field and follow our suggestion in the previous post.

In other case, please send us screen shots for the configuration of your search type.

Regards,
Mehdi.

Get a VIP membership