[Koha-bugs] [Bug 10542] QueryParser + OpacSuppression doesn't allow search in 'all libraries'

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jul 18 04:43:21 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10542

--- Comment #18 from David Cook <dcook at prosentient.com.au> ---
Ah, I believe that Galen was incorrect. QueryParser indeed does appear to
handle negation.

QueryParser:

[Negation via query_plan.pm]
(test) && !(suppress:1)
OR
(test) && -(suppress:1)

OR

[Negation via node.pm]
(test) && (suppress:!"1")
OR
(test) && (suppress:-"1")

(N.B. When negating at the "node" level, you have to wrap the 1 in quotes to
treat it as a phrase or else the ! or - appear to be parsed as part of the
operand.)

CCL:
(test) not (suppress:1)

If you think about it, "not" really is "and not", so CCL's "not" is equivalent
to "&& !" in QP.

------

Ahh...so I've finally read through Martin's patch. 

tl;dr

Martin, if you change the following:

$query = "$query -suppress:1";

to:

$query = "($query) && -(suppress:1)";

It should work.

[Note: If we wanted to add other fields to disallow, we could throw them inside
that disallowed group when using QP as well...]

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list