<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=utf-8"><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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></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=blue vlink=purple><div class=WordSection1><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>After sending an email to Adam at Indexdata (and the Zebra/YAZ lists), I need to revise my last comment on this thread…<o:p></o:p></span></a></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>The URL </span>cgi-bin/koha/catalogue/<a href="http://search.pl?q=ccl%3Dlex%2Cst-numeric%3D500-600">search.pl?q=ccl%3Dlex%2Cst-numeric%3D500-600</a> is better read as lex,st-numeric:500-600 which works.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>However, the URL cgi-bin/koha/catalogue/<a href="http://search.pl?idx=lex%2Cst-numeric&q=500-600">search.pl?idx=lex%2Cst-numeric&q=500-600</a> creates the CCL query (rk=( lex,st-numeric="300-600")) which is translated into PQF as @attr 1=9903 @attr 4=109 @attr 2=102 300-600, which generates the error [117] Unsupported Relation attribute -- v2 addinfo ''.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The problem is due to the rk=() and the double quotes. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The double quotes make CCL2RPN think that it’s a single term and not a range. So it doesn’t do the r=r/r=o magic. If you remove those quotes to form a CCL query of (rk=( lex,st-numeric=300-600)), you’ll get a PQF query of @and @attr 1=9903 @attr 4=109 @attr 2=102 300 @attr 1=9903 @attr 4=109 @attr 2=102 600, which still generates the error [117] Unsupported Relation attribute -- v2 addinfo ''… but it’s more in line with what we’d expect the PQF query to look like.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>You might notice here that the problem with the query is that the relation attributes of @attr 2=4 and @attr 2=2 are being replaced with @attr 2=102. This means it won’t be treated as a range, which is definitely not what we want!<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>But we don’t even get that far… we get that error because it seems that the @attr 4=109 structure attribute doesn’t seem to play nicely with @attr 2=102 (relevance). <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think it’s a bug in the CCL2RPN conversion. The rk=() is specified at a higher level than the r=r/r=o special attributes, so the @attr 2=4 and @attr 2=2 attributes shouldn’t be overwritten. However, we’ll see what Indexdata has to say about the issue…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>David Cook<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Systems Librarian<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Prosentient Systems<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>72/330 Wattle St, Ultimo, NSW 2007<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> koha-devel-bounces@lists.koha-community.org [mailto:koha-devel-bounces@lists.koha-community.org] <b>On Behalf Of </b>Barton Chittenden<br><b>Sent:</b> Friday, 6 November 2015 3:47 AM<br><b>To:</b> Koha-devel <koha-devel@lists.koha-community.org><br><b>Subject:</b> [Koha-devel] Searching numeric ranges<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>I am working on searching lexile number ranges.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>ccl.properties shows<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>    lex 1=9903 r=r<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>The 'r=r' bit means that I should be able to search using a numeric range separated by a dash, e.g.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>   500-600<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Should return any numeric results from 500 to 600.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>The following query works:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>   cgi-bin/koha/catalogue/<a href="http://search.pl?q=ccl%3Dlex%2Cst-numeric%3D500-600">search.pl?q=ccl%3Dlex%2Cst-numeric%3D500-600</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>However, when I try adding that as an item in the search menu, as follows:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>    $(document).ready(function(){<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>        //add lexile to search pull downs<o:p></o:p></p></div><div><p class=MsoNormal>        $("select[name='idx']").append("<option value='lex,st-numeric'>Lexile (e.g. 600 or 550-650 )</option>");<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>    }); <o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>That gets munged... the url reads<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>    cgi-bin/koha/catalogue/<a href="http://search.pl?idx=lex%2Cst-numeric&q=500-600">search.pl?idx=lex%2Cst-numeric&q=500-600</a><o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>And I get the following message:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>    No results found<o:p></o:p></p></div><div><p class=MsoNormal>    No results match your search for 'lex,st-numeric: 500-600'. <o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>--Barton<o:p></o:p></p></div></div></div></div></body></html>