[Koha] Curious searching problem with zebra

Chris Cormack chris at bigballofwax.co.nz
Sun Dec 19 06:43:41 NZDT 2010


On 19 December 2010 06:35, Paul <paul.a at aandc.org> wrote:
> At 05:01 AM 12/19/2010 +1300, Chris Cormack wrote:
>> >[snip]
>> > I'm not disagreeing with your solution, just trying to come up with
>> > alternatives.
>> >
>>Sure,  I'm just unsure why :) The problem is we are treating the word
>>and as an operator, if we don't do that, the problem goes away.
>
> In other environments that I work in, the boolean operator AND has to be
> ALL CAPS. I have not looked at the code, but from the zebra manual there
> might be some possibility of mapping the command line (PQF?) " @and " to an
> allcaps AND, exclusive of lower|mixed case and|And.
>
Hi Paul

We are using ccl, ill cut and paste from the bug summary, as it seems
no one has read it.

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

"I have found the problem

In our ccl.properties file around line 1105 we have

@and and +

Which sets the and operater to be and or + .. which means when we pass and in
our query it gets evaluated as an operator. To fix this

We can change that to something like

@and +++

Now +++ is the operator for and, and then we need to change C4/Search.pm to set
+++ instead of and in the ccl when we want to and terms together so

ti=fish and author=bob would be ti=fish +++ author=bob"

We could instead decide to use AND ... but I think trying to use a
string that is much more unlikely to be accidentally typed would be
better.
If this discussion is to continue it would be better to move it over
to the koha-devel list.

Chris


More information about the Koha mailing list