Bug 28513 - Analytic search links formed incorrectly
Summary: Analytic search links formed incorrectly
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Joonas Kylmälä
QA Contact: Testopia
URL:
Keywords:
Depends on: 15851
Blocks: 28682
  Show dependency treegraph
 
Reported: 2021-06-04 09:39 UTC by Joonas Kylmälä
Modified: 2021-07-10 01:42 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.02,20.11.08


Attachments
Bug 28513: Fix analytics search links so they don't match unrelated biblios (5.00 KB, patch)
2021-06-04 11:25 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 28513: Fix analytics search links so they don't match unrelated biblios (5.10 KB, patch)
2021-06-04 22:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 28513: Fix analytics search links so they don't match unrelated biblios (5.17 KB, patch)
2021-06-11 17:17 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Joonas Kylmälä 2021-06-04 09:39:52 UTC
In catalogue/detail.pl we form the analytics links like this:

Host-item:$cleaned_title

but that means we only search from Host-item field only the first token in the title, other tokens get searched from all fields. Same error is when forming the links to display in koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
Comment 1 Joonas Kylmälä 2021-06-04 11:25:22 UTC
Created attachment 121629 [details] [review]
Bug 28513: Fix analytics search links so they don't match unrelated biblios

At least when using Searchengine=Elasticsearch what happened was that
without () parenthese included the search for Host-item field was done
only to the first token, the subsequent ones matched any
fields. Adding the parentheses restrict the search to Host-item search
field only.

To test:
 1) Set Searchengine = elasticsearch
 2) Make a biblio with 245a = "biológica paranaense." and 773a = "Acta"
 3) Go to a biblio with 245a = "Acta biológica paranaense" (in
 kohadevbox or create one if you need).
 4) Notice that the "Acta biológica paranaense" biblio's detail page link "Show
 analytics" takes to the "biológica paranaense" incorrectly just
 because the 773a has "Acta" and the words "biológica" and "paranaense"
 appear elsewhere in the biblio.
 5) Apply patch and notice the link is now not created at all
Comment 2 David Nind 2021-06-04 22:25:17 UTC
Created attachment 121635 [details] [review]
Bug 28513: Fix analytics search links so they don't match unrelated biblios

At least when using Searchengine=Elasticsearch what happened was that
without () parenthese included the search for Host-item field was done
only to the first token, the subsequent ones matched any
fields. Adding the parentheses restrict the search to Host-item search
field only.

To test:
 1) Set Searchengine = elasticsearch
 2) Make a biblio with 245a = "biológica paranaense." and 773a = "Acta"
 3) Go to a biblio with 245a = "Acta biológica paranaense" (in
 kohadevbox or create one if you need).
 4) Notice that the "Acta biológica paranaense" biblio's detail page link "Show
 analytics" takes to the "biológica paranaense" incorrectly just
 because the 773a has "Acta" and the words "biológica" and "paranaense"
 appear elsewhere in the biblio.
 5) Apply patch and notice the link is now not created at all

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Nick Clemens 2021-06-11 17:17:18 UTC
Created attachment 121869 [details] [review]
Bug 28513: Fix analytics search links so they don't match unrelated biblios

At least when using Searchengine=Elasticsearch what happened was that
without () parenthese included the search for Host-item field was done
only to the first token, the subsequent ones matched any
fields. Adding the parentheses restrict the search to Host-item search
field only.

To test:
 1) Set Searchengine = elasticsearch
 2) Make a biblio with 245a = "biológica paranaense." and 773a = "Acta"
 3) Go to a biblio with 245a = "Acta biológica paranaense" (in
 kohadevbox or create one if you need).
 4) Notice that the "Acta biológica paranaense" biblio's detail page link "Show
 analytics" takes to the "biológica paranaense" incorrectly just
 because the 773a has "Acta" and the words "biológica" and "paranaense"
 appear elsewhere in the biblio.
 5) Apply patch and notice the link is now not created at all

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Jonathan Druart 2021-06-21 10:06:35 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 5 Kyle M Hall 2021-06-25 13:51:57 UTC
Pushed to 21.05.x for 21.05.02
Comment 6 Victor Grousset/tuxayo 2021-07-08 02:46:01 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.
Comment 7 Fridolin Somers 2021-07-10 01:42:21 UTC
Pushed to 20.11.x for 20.11.08