<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1379352563;
        mso-list-type:hybrid;
        mso-list-template-ids:-319415966 201916431 201916441 201916443 201916431 201916441 201916443 201916431 201916441 201916443;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Hi all,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I ran into a problem today where the search query ‘Emperor penguin (Aptenodytes forsteri) foraging ecology’ (without single quotes) was creating a "CCL parsing error" in Zebra. I had QueryAutoTruncate enabled so QueryWeightFields was automatically disabled.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Solutions include:<o:p></o:p></p><ol style='margin-top:0cm' start=1 type=1><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo1'>Wrap the search query in double quotes<o:p></o:p></li><ol style='margin-top:0cm' start=1 type=a><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level2 lfo1'>"Emperor penguin (Aptenodytes forsteri) foraging ecology"<o:p></o:p></li></ol><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo1'>Escape the parentheses with a backslash<o:p></o:p></li><ol style='margin-top:0cm' start=1 type=a><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level2 lfo1'>Emperor penguin \(Aptenodytes forsteri\) foraging ecology<o:p></o:p></li></ol><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo1'>Turn off QueryAutoTruncate<o:p></o:p></li><ol style='margin-top:0cm' start=1 type=a><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level2 lfo1'>This lets the weighted query code thoroughly mangle the query which includes wrapping it in double quotes.<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level2 lfo1'>Note though that this option also makes it so that a search wrapped in double quotes (like Solution 1) becomes a CCL parsing error<o:p></o:p></li></ol></ol><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think many of us know that Koha’s Zebra-based query building is terrible, but changing it obviously has consequences and we have so many different search preference permutations that it makes it difficult to regression test search changes.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>We could start showing users when they have searches with syntax errors… but then we all will probably start getting a lot of calls. Although I was thinking that when showing that there was a syntax error with their query, we could also provide a little “cheat sheet” with the basics of Zebra’s CCL syntax. (Of course, that’s really only relevant when we’re passing queries straight through to Zebra and not butchering them first in Koha.)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>We could try to fix search, but then who has the time/money for that? Why fix something that is not (seemingly) broken?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am wondering what other people think. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Personally, I’m thinking that we should not allow complex queries in the OPAC “Search” box. We treat that box (as we always should have) as the operand to the index chosen in the “Library catalogue” drop down list. However… that would be a breaking change for anyone that has bookmarked any OPAC searches with complex search queries. I suppose that we could create a new System Preference like “SimplifySearch” and just enable that for new Koha installations though. Maybe one day we could then remove that system preference and just make it “The Way”. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>After all, I think that the *<b>majority</b>* of people are going to be performing fairly straight forward searches in the OPAC “Search” box. They’re not going to be doing things like ‘(kw,phr,rtrn:”David writes verbose emails”) OR ( (ti,phr,ext:”I think David’s ideas have some merit”) AND (su:Emails) )’. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Relevant bugs:<o:p></o:p></p><p class=MsoNormal><a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27088">https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27088</a><o:p></o:p></p><p class=MsoNormal><a href="https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27139">https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27139</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>David Cook<o:p></o:p></p><p class=MsoNormal>Software Engineer<o:p></o:p></p><p class=MsoNormal>Prosentient Systems<o:p></o:p></p><p class=MsoNormal>72/330 Wattle St<o:p></o:p></p><p class=MsoNormal>Ultimo, NSW 2007<o:p></o:p></p><p class=MsoNormal>Australia<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Office: 02 9212 0899<o:p></o:p></p><p class=MsoNormal>Online: 02 8005 0595<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>