Created attachment 149588 [details] [review] Bug 29185: Facilitate searching for cnum Instead of typing the case sensitive Control-number each time. 4 strikes instead of 15 on your keyboard. Wow! Gain of 73%. Test plan: Copy ccl.properties to /etc/koha/zebradb, restart Zebra and search for cnum=SOME_ID in opac or intranet. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 149589 [details] [review] Bug 29185: Groundwork: add template GetCnumSearchURL in Utils Note for QA: Opened bug 33515 to see if we can use this same function in a few other places too. Would probably reduce code and increase consistency. Test plan: See next patch. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 149590 [details] [review] Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT Test plan: ** For OPAC [1] Pick a biblio record A as original entry, fill $001/$003. [2] Pick another biblio record B as translation, add 765 with $t, $a and $d. Put (orgcode)cnum from A into $w. [3] Disable UseControlNumber. [4] Goto OPAC detail page of B. Check link; should be title based. [5] Enable UseControlNumber. [6] Goto OPAC detail page of B. Check link; should incl orgcode and cnum. [7] Edit B. Replace $w with cnum of A only. [8] Goto OPAC detail page of B. Check link; should incl cnum only. ** For staff client [9] Goto staff detail page of B. Check link again. [10] Edit B. Set 765 ind2 to 8, fill $i. [11] Goto staff detail page of B. You should see different label. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Katrin: Please take a look at the logic in the second patch building a URL for control-number and corresponding identifier. Depends on UseControlNumber pref too. Additionally, it looks at the orgcode if present and narrows the search down to that orgcode too.
Created attachment 149906 [details] [review] Bug 29185: Facilitate searching for cnum Instead of typing the case sensitive Control-number each time. 4 strikes instead of 15 on your keyboard. Wow! Gain of 73%. Test plan: Copy ccl.properties to /etc/koha/zebradb, restart Zebra and search for cnum=SOME_ID in opac or intranet. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 149907 [details] [review] Bug 29185: Groundwork: add template GetCnumSearchURL in Utils Note for QA: Opened bug 33515 to see if we can use this same function in a few other places too. Would probably reduce code and increase consistency. Test plan: See next patch. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 149908 [details] [review] Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT Test plan: ** For OPAC [1] Pick a biblio record A as original entry, fill $001/$003. [2] Pick another biblio record B as translation, add 765 with $t, $a and $d. Put (orgcode)cnum from A into $w. [3] Disable UseControlNumber. [4] Goto OPAC detail page of B. Check link; should be title based. [5] Enable UseControlNumber. [6] Goto OPAC detail page of B. Check link; should incl orgcode and cnum. [7] Edit B. Replace $w with cnum of A only. [8] Goto OPAC detail page of B. Check link; should incl cnum only. ** For staff client [9] Goto staff detail page of B. Check link again. [10] Edit B. Set 765 ind2 to 8, fill $i. [11] Goto staff detail page of B. You should see different label. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. Zebra changes - after applying the patches: 1.1 cp etc/zebradb/ccl.properties /etc/koha/zebradb/ 1.2 sudo koha-zebra --restart -v kohadev 2. Set up for testing - make these tags and subfields visible in the editor for the BKS MARC framework: 2.1 003 2.2 765$a, $d, $i, $t, and $w 3. Records used: - Record A: Programming Perl (biblionumber=262) - Record B: CGI programming with Perl (biblionumber=11) 4. cnum searching (OPAC and staff interface - should return Programming Perl): cnum=17259930 5. Step 2 of the test plan - 765$w: (OSt)17259930
(In reply to David Nind from comment #7) > Signed-off-by: David Nind <david@davidnind.com> Thx David.
Just checking with Nick whether we need any index changes for ES to work with this too.. otherwise I'm happy to PQA
Nick said: "The only bit I am not sure about is the indexing, there is some massaging it looks like in the utils - and I don't see where we have an equivalent in ES" So, that confirms my suspicions that we might need to do more for this to work with ES
Created attachment 150357 [details] [review] Bug 29185: Facilitate searching for cnum Instead of typing the case sensitive Control-number each time. 4 strikes instead of 15 on your keyboard. Wow! Gain of 73%. Test plan: Copy ccl.properties to /etc/koha/zebradb, restart Zebra and search for cnum=SOME_ID in opac or intranet. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 150358 [details] [review] Bug 29185: Groundwork: add template GetCnumSearchURL in Utils Note for QA: Opened bug 33515 to see if we can use this same function in a few other places too. Would probably reduce code and increase consistency. Test plan: See next patch. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 150359 [details] [review] Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT Test plan: ** For OPAC [1] Pick a biblio record A as original entry, fill $001/$003. [2] Pick another biblio record B as translation, add 765 with $t, $a and $d. Put (orgcode)cnum from A into $w. [3] Disable UseControlNumber. [4] Goto OPAC detail page of B. Check link; should be title based. [5] Enable UseControlNumber. [6] Goto OPAC detail page of B. Check link; should incl orgcode and cnum. [7] Edit B. Replace $w with cnum of A only. [8] Goto OPAC detail page of B. Check link; should incl cnum only. ** For staff client [9] Goto staff detail page of B. Check link again. [10] Edit B. Set 765 ind2 to 8, fill $i. [11] Goto staff detail page of B. You should see different label. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
OK, confirms we're only adding an alias here and elasticsearch is handled. Passing QA
(In reply to Martin Renvoize from comment #11) > Nick said: > > "The only bit I am not sure about is the indexing, there is some massaging > it looks like in the utils - and I don't see where we have an equivalent in > ES" > > So, that confirms my suspicions that we might need to do more for this to > work with ES From IRC: [09:26] <marcelr> +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -82,6 +82,7 @@ our %index_field_convert = ( + 'cnum' => 'control-number', [09:28] <marcelr> admin/searchengine/elasticsearch/mappings.yaml: control-number: [09:28] <marcelr> i am not adding something new, but just an alias
(In reply to Martin Renvoize from comment #15) > OK, confirms we're only adding an alias here and elasticsearch is handled. > > Passing QA Thanks
Created attachment 150365 [details] [review] Bug 29185: (QA follow-up) Capitalize AND to ensure it is a boolean for ES
(In reply to Marcel de Rooy from comment #16) > (In reply to Martin Renvoize from comment #11) > > Nick said: > > > > "The only bit I am not sure about is the indexing, there is some massaging > > it looks like in the utils - and I don't see where we have an equivalent in > > ES" > > > > So, that confirms my suspicions that we might need to do more for this to > > work with ES > > From IRC: > > [09:26] <marcelr> +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ > -82,6 +82,7 @@ our %index_field_convert = ( + 'cnum' => > 'control-number', > [09:28] <marcelr> admin/searchengine/elasticsearch/mappings.yaml: > control-number: > [09:28] <marcelr> i am not adding something new, but just an alias Ah, I thought I saw some handling in the zebra xslt, but I must have gotten confused. Tested and works nicely with a minor follow-up
I think quoting here is a bit naive... Can we make it use the quote_search_terms XSLT template we have: https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl#L589 Example usage: https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl#L219-L223
Adjust and it will get pushed. No need to be PQA by the freeze.
(In reply to Tomás Cohen Arazi from comment #20) > I think quoting here is a bit naive... Can we make it use the > quote_search_terms XSLT template we have: > > https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha- > tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl#L589 > > Example usage: > https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha- > tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl#L219-L223 Could you elaborate on this one please? Which construction do you object to ? <xsl:value-of select="normalize-space(translate(substring-before(marc:subfield[@code=$cnum_subfield],')'),'()',''))"/> OR <xsl:value-of select="str:encode-uri(concat($scriptname,'?q=ti,phr:',translate(marc:subfield[@code=$title_subfield], '()', '')),false())"/> In both cases it is not just about quoting a URI part. Note that they are not completely new inventions, but adjusted existent constructs moved to a central template.
<tcohen> you are manually quoting something that comes from the record [17:02] <tcohen> and could in theory contain quote chars
(In reply to Marcel de Rooy from comment #23) 17:02] <tcohen> the latter > <tcohen> you are manually quoting something that comes from the record > [17:02] <tcohen> and could in theory contain quote chars
Created attachment 151009 [details] [review] Bug 29185: (QA follow-up) Quote title search in GetCnumSearchURL Test plan: Disable UseControlNumber Change biblio title to something like: Hamlet or CHINESE_CHARS where you add some nice Chinese chars. Create a 765 looking for that title in another biblio record. Without this patch, the link at detail page finds both records, since it looks for ti-phr:Hamlet OR the Chinese chars. With this patch, the link at detail uses quotes and finds only one, since the OR is now part of the ti-phr search. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 23.05. Nice work everyone, thanks!
Enhancement - not backporting to 22.11.x
No update to Koha Manual needed.