Boolean search

Tell us what could be improved in MyInfo
Post Reply
m248
Posts: 2
Joined: Sun Sep 01, 2024 10:01 am

Boolean search

Post by m248 »

I have only found another thread re Boolean search which states that combinations are possible in perspectives but I need either of the following (ideally both, but one would be sufficient) by the search bar, to apply it to various on-the-spot searches:

a) A toggle for precedence. Currently, the precedence AND over OR is fixed, which makes most compound searches impossible (see below); a toggle would allow me to switch it to OR over AND which would be a serious relief indeed.

b) Even better: Grouping being taken into account, parentheses not being discarded by the underlying code anymore.

Could you please comment if one of these solutions is on your list, even for quite soon, or are they both out of the question?

Discussion:

Currently (AND is explicit or implicit, I write it out here for clarity reasons),

a OR b OR c OR d AND e
is translated to (a OR b OR c) OR (d AND e) (fixed AND precedence)
and
( a OR b OR c OR d ) AND e
(which is the intended SQL search) is also translated to (a OR b OR c) OR (d AND e)
(by the fixed AND precedence and the grouping parentheses being discarded internally)
which is obviously not what I want since I have lots of ORs (for necessary synonyms of the main search term, needing ORs), but just one (or two, in rare cases) (secondary) "AND" search terms.

Thus, in order to do my "standard" searches (main search term with synonyms, then a "in combination with" = secondary search term (in case with a single synonym)), I have to write, for a single secondary term:
a AND e OR b AND e OR c AND e OR d AND e
or, for two secondary "OR" search terms:
a AND e OR b AND e OR c AND e OR d AND e OR a AND f OR b AND f OR c AND f OR d AND f
instead of just:
( a OR b OR c OR d ) AND ( e OR f ) (if grouping was allowed / taken into account),
or (no grouping allowed, but precedence toggle, now OR over AND), simply:
a OR b OR c OR d AND e OR f

Thus it becomes obvious that most real-life searches will (necessarily) comprise synonyms, thus making the OR over AND precedence necessary, be it by precedence toggle, or by grouping.
jamal
Posts: 198
Joined: Sat Jan 13, 2007 12:29 pm

Post by jamal »

AND’s precedence over OR is generally the norm and widely expected behavior (except where there are no precedence rules, and it simply parses from left to right). At the same time, use of parenthesis (grouping) allows the user to change the order of operations in any manner desirable. So, if grouping/parenthesis is not working, I think, there lies the problem. imho, adding additional toggling and complexity is NOT the solution!
m248
Posts: 2
Joined: Sun Sep 01, 2024 10:01 am

Post by m248 »

OK you're right. Sorry for bothering!
Post Reply