Searching on "and the band played on" returns no results. There are 3 biblios for that title, a book, a DVD and a video.
The error log shows:
[Thu Dec 16 17:18:27 2010] [error] [client 127.0.0.2] [Thu Dec 16 17:18:27 2010] search.pl: WARNING: query problem with kw,wrdl,rtrn=and band played ZOOM error 10014 "CCL parsing error" (addinfo: "Search word expected") from diag-set 'ZOOM' at /usr/share/koha/lib/C4/Search.pm line 346., referer: http://127.0.0.2:8080/cgi-bin/koha/mainpage.pl
This happens with Koha 3.02.01 on openSUSE 11.3 (32-bit and 64-bit) and on Debian squeeze/sid (64-bit) with zebra.
Searching on 'the band played on' gets all three records.
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
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
Semi-related - "not" in a basic search is treated as an operator, not a search term, which can produce unexpected results. Thus, @not (and for completeness, @and and @or) could be changed as well.
This does beg the question of what the best search grammar (from the POV of the user) should be, so this would be an area for configuration hooks to be added.
My research is showing this to be an issue with the truncation; if QueryAutoTruncate is off, no error message is generated.
The error seems to occur when searching kw,wrdl,rtrn:and whatever
With QueryAutoTruncate off, the weighting kicks in, and the search terms are wrapped in quotes, preventing the parse error.
Confirmed this in 3.6.3 :)
What is the recommended course of action?
[Tue Jul 17 16:38:23 2012] [error] [client 192.168.100.2] [Tue Jul 17 16:38:23 2012] opac-search.pl: WARNING: query problem with kw,wrdl,rtrn=and the word came with power and branch=MNL ZOOM error 10014 "CCL parsing error" (addinfo: "Search word expected") from diag-set 'ZOOM' at /usr/share/koha/lib/C4/Search.pm line 355.
I changed the QueryAutoTruncate from "automatically" to "only if there is a *", and the problem went away. However, if I tried to query "and the word came with pow*", it would generate the same error. Given that our users don't think of using *, I'm leaving it changed, but it would be nice not to have the error with starting with "and" and having an asterisk.
I had similar problems with current master.
And the band played -> No results
the band played ->results
Beauty and the beast -> results
and the beast -> no results
Beauty and -> no results
Still valid on current master
And the music speaks
And the music speaks => fail
the music speaks => success
Max and Moritz
Max and Moritz => success
and Moritz => fail