This preference only for OPAC to show the number of records next to search links in the bibliographic record detail page.
Created attachment 115159 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC.
Created attachment 115206 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Bug 27428: Show the number of records in the bibliographic. Update code.
I have applied the patch but I can't get it to work. Maybe I misunderstand how it is supposed to work. Can you clarify what it should look like, maybe post a screen shots?
I see an error in the console: Could not compile /kohadevbox/koha/opac/svc/elasticsearch/opac-autocomplete.pl: Can't locate Switch.pm in @INC (you may need to install the Switch module)
I see this line in the patch for opac/svc/elasticsearch/opac-autocomplete.pl: 8 use Switch; But it doesn't seem to be used in the code? There seems to be other modules used which aren't used either.
Sorry, the Switch module is the only one which isn't actually used in the code. There are no switch or case statements.
I recall dependency on Text::Unaccent was recently removed by Bug 14759, replaced by Unicode::Normalize. We shouldn't ad it back in, perhaps.
Created attachment 117950 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Remove Switch.
(In reply to Frank Hansen from comment #3) > I have applied the patch but I can't get it to work. Maybe I misunderstand > how it is supposed to work. Can you clarify what it should look like, maybe > post a screen shots? Same as Franck, I don't see differents in bib record page when I enable the syspref. It seems I misunderstood something too.
Created attachment 119980 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Bug 27113: ElasticSearch: Autocomplete in input search. Use Unicode::Normalize instead Text::Unaccent.
This patch includes elasticsearch/opac-autocomplete.pl. Does that change belong here?
That shoudl be opac-elasticsearch.pl (or similar generic name) in here and Bug 27113
Created attachment 120034 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC.
Created attachment 120633 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
The number of records did show, but some of the search words got the number 0, and that is obviously wrong. See: Subject(s): Clans -- Scotland -- Great Glen -- History -- 17th century [1] | Clans -- Scotland -- Great Glen -- History -- 18th century [1] | Jacobites [2] | Great Glen (Scotland) -- History [1] | Highlands (Scotland) -- History [0] | Scotland -- History -- 17th century [1] | Scotland -- History -- 18th century [0] From opac-detail.pl?biblionumber=60.
(In reply to Stina Hallin from comment #15) > The number of records did show, but some of the search words got the number > 0, and that is obviously wrong. See: > Subject(s): Clans -- Scotland -- Great Glen -- History -- 17th century [1] | > Clans -- Scotland -- Great Glen -- History -- 18th century [1] | Jacobites > [2] | Great Glen (Scotland) -- History [1] | Highlands (Scotland) -- History > [0] | Scotland -- History -- 17th century [1] | Scotland -- History -- 18th > century [0] > From opac-detail.pl?biblionumber=60. Stina, if you find things that are obviously wrong, you may change the status of the patch to Failed QA.
+('OPACDisplayRecordCount','0',NULL,NULL,'YesNo') Please add description here
+ default: no + choices: + 1: Show + 0: "Don't show" You probably mean default 0 ?
Created attachment 132068 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Ok, I got it now ! It works nice :) I've got few questions though before signing it. I wonder what is the perimeter of the application : does the feature applied for every search link available in the record ? I saw that some special signs are not taken into account in the search but some are kept such like ';' or ':'. Is it a specific reason for that, for I don't get the logic ? This special signs can lead to unsuccessful searches so, for some records with a lot of informations, I wonder if, in the case result is [0], it's useful to display the information (see screenshot https://snipboard.io/RvlewS.jpg)
Created attachment 139625 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Created attachment 139626 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Created attachment 139681 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Created attachment 145222 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com>
FAIL Koha/SearchEngine/Elasticsearch/Browse.pm OK critic OK forbidden patterns OK git manipulation OK pod FAIL pod coverage POD is missing for 'count_record' SKIP spelling OK valid OK installer/data/mysql/mandatory/sysprefs.sql OK git manipulation OK semicolon OK sysprefs_order FAIL koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc FAIL filters asset_must_be_raw at line 52 ( [% Asset.js("js/opac-display-record-count.js") %]) OK forbidden patterns OK git manipulation OK js_in_body SKIP spelling OK tt_valid OK valid_template OK koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt OK filters OK forbidden patterns OK git manipulation OK js_in_body SKIP spelling OK tt_valid OK valid_template FAIL koha-tmpl/opac-tmpl/bootstrap/js/opac-display-record-count.js FAIL ES template literals ES template literals found ( var regex = `a[href*="${regex_es_link}"]`;) - See bug 24725
Created attachment 148842 [details] [review] Bug 27428: (QA follow-up) Add missing POD, remove ES template literals in opac-display-record-count.js
Created attachment 154509 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com> Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Created attachment 154510 [details] [review] Bug 27428: (QA follow-up) Add missing POD, remove ES template literals in opac-display-record-count.js Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Hi, this is a really interesting feature! Some notes: 1) The QA test tools are currently still failing, but it's only a perltidy that is needed. 2) The database update still has the old format and should be moved to the newer atomic update template. 3) The system preference is added correctly, but should a) Include a note that this feature is "Elasticsearch only" b) Be moved to the "Features" section instead of the "Did you mean" where it appears now. 4) It didn't work in my testing :( Maybe something broke with changes made to the OPAC since this was submitted the first time? * I used ktd --es7 up * Made sure SearchEngine was Elasticsearch and search worked * Applied patch * restart_all * Turned on OPACDisplayRecordCount system preference I don't see any errors in the console, but the JSON responses come back empty, possibly because the q param is empty:: http://localhost:8080/cgi-bin/koha/svc/elasticsearch/opac-elasticsearch.pl?q=[]&key=nb_notice ? I searched for "perl" in a MARC21 sample database and paged through a lot of the results with no counts showing. 5) Code review * Please translate code comments if you want to keep them: +/* Regex pour tous les URL avec un recherche */ This uses the older /svc pattern, we might want to get a second more technical review on this one.
Created attachment 158639 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com> Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Created attachment 158640 [details] [review] Bug 27428: (QA follow-up) Add missing POD, remove ES template literals in opac-display-record-count.js Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Created attachment 158641 [details] [review] Bug 27428: (follow-up) perltidy, change the atomic file to the newer format, moving system preference to Features section and Fixing opac-display-record-count.js
Created attachment 161349 [details] [review] Bug 27428: (follow-up) Fix Session
Created attachment 164557 [details] [review] Bug 27428: Show the number of records in the bibliographic record detail page with ElasticSearch. Tests: 1. Apply this patch; 2. In the Preference system - OPACDisplayRecordCount -> Show; 3. We can see the number of records next to search links in the bibliographic record detail page in the OPAC. Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com> Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Created attachment 164558 [details] [review] Bug 27428: (QA follow-up) Add missing POD, remove ES template literals in opac-display-record-count.js Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Created attachment 164559 [details] [review] Bug 27428: (follow-up) perltidy, change the atomic file to the newer format, moving system preference to Features section and Fixing opac-display-record-count.js
Created attachment 164560 [details] [review] Bug 27428: (follow-up) Fix Session