<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: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:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><a name="_MailEndCompose">Sorry to spam you all…<o:p></o:p></a></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The following works:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>$QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser') && ! ( grep { $_->{'index'} =~ m/\w,\w/ } @{ $self->{'matchpoints'} }));<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>We might want to actually double-check other places in Koha where we’re checking for ‘UseQueryParser’, as it might not always be possible to use the QueryParser due to limitations such as the “qualifier,qualifier” CCL syntax.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>David Cook<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>Systems Librarian<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>Prosentient Systems<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>72/330 Wattle St, Ultimo, NSW 2007<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></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='mso-fareast-language:EN-AU'>From:</span></b><span lang=EN-US style='mso-fareast-language:EN-AU'> David Cook [mailto:dcook@prosentient.com.au] <br><b>Sent:</b> Tuesday, 19 January 2016 3:31 PM<br><b>To:</b> 'Koha Devel' <koha-devel@lists.koha-community.org><br><b>Subject:</b> RE: Searching URLs in Zebra<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Ah, just realized again that qq($QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser') && ! ($query =~ m/\w,\w|\w=\w/));) won’t work in C4::Matcher because there’s no $query…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The only equivalent of that would be to check all the $matchpoint->{‘index’} fields in the $self->{‘matchpoints’} arrayref… <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Which we might have to do because the QueryParser doesn’t seem to be able to handle the “index,phr” (ie “qualifier,qualifier”) format. That’s verified by the fact that C4::Search::SimpleSearch is doing that regex. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sure, we could just not use a list of qualifiers for a Record Matching Rule index, but then we have no control over what index register we’re using and that’s also a problem.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>David Cook<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>Systems Librarian<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>Prosentient Systems<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>72/330 Wattle St, Ultimo, NSW 2007<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></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='mso-fareast-language:EN-AU'>From:</span></b><span lang=EN-US style='mso-fareast-language:EN-AU'> David Cook [<a href="mailto:dcook@prosentient.com.au">mailto:dcook@prosentient.com.au</a>] <br><b>Sent:</b> Tuesday, 19 January 2016 3:11 PM<br><b>To:</b> 'Koha Devel' <<a href="mailto:koha-devel@lists.koha-community.org">koha-devel@lists.koha-community.org</a>><br><b>Subject:</b> Searching URLs in Zebra<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hey brains trust,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m reaching out to everyone as I’m a bit stuck with <a href="http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15541">http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15541</a> at the moment.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>There’s currently no way to search an index with the “url” (ie “u”) register.  A URL is stored “as is” in that index, but all our Koha search methods use s/:/=/g or s/=/:/g and that plays havoc with the URLs used in a search query, which makes the match fail against the indexed URL. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>C4::Matcher::get_matches() strips spaces and punctuation, so I’ve added a “none” or “raw” normalizer that performs no normalization, but C4::Search::SimpleSearch() does that global replacement for “:” and “=” (depending on your QueryParser settings and what qualifiers you’ve specified in your Record Matching Rules).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I thought about adding a “skip normalization” flag to C4::Search::SimpleSearch, but that doesn’t work because C4::Matcher uses : for QueryParser and = for non-QueryParser… except C4::Search::SimpleSearch() deactivates QueryParser mode if you have a “index,phr” set of qualifiers… which means that you get a “:” when you need a “=” for the non-QueryParser CCL query…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I suppose the solution might be the following:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Current Matcher.pm:<o:p></o:p></p><p class=MsoNormal>$QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser'));<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Current Search.pm<o:p></o:p></p><p class=MsoNormal>$QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser') && ! ($query =~ m/\w,\w|\w=\w/));<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Future Matcher.pm:<o:p></o:p></p><p class=MsoNormal>$QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser') && ! ($query =~ m/\w,\w|\w=\w/));<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If I just have that conditional the same in both Search.pm and Matcher.pm… then maybe a “skip_normalization” flag in SimpleSearch() would work…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I might try that in a minute… but opening it up because I could really use a hand with this.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>David Cook<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>Systems Librarian<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>Prosentient Systems<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-AU'>72/330 Wattle St, Ultimo, NSW 2007<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>