Bug 23004 - Missing authtype filter in auth_finder.pl
Summary: Missing authtype filter in auth_finder.pl
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: master
Hardware: All All
: P5 - low major with 10 votes (vote)
Assignee: Fridolin SOMERS
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-29 06:13 UTC by Fridolin SOMERS
Modified: 2019-10-17 19:06 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.04


Attachments
Bug 23004: Missing authtype filter in auth_finder.pl (1.66 KB, patch)
2019-05-29 06:22 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 23004: Unit test (1.51 KB, patch)
2019-08-08 06:52 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 23004: Missing authtype filter in auth_finder.pl (1.73 KB, patch)
2019-09-06 11:02 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23004: Missing authtype filter in auth_finder.pl (1.73 KB, patch)
2019-09-06 11:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23004: Unit test (1.58 KB, patch)
2019-09-06 11:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 23004: Missing authtype filter in auth_finder.pl (1.76 KB, patch)
2019-09-09 16:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 23004: Unit test (1.62 KB, patch)
2019-09-09 16:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2019-05-29 06:13:47 UTC
In cataloguing, the use of tag editor opens authorities finder with a limit on specific authorities type.
This limit is missing with Elasticsearch.
Comment 1 Fridolin SOMERS 2019-05-29 06:22:39 UTC
Created attachment 90174 [details] [review]
Bug 23004: Missing authtype filter in auth_finder.pl

In cataloguing, the use of tag editor opens authorities finder with a limit on specific authorities type.
This limit is missing with Elasticsearch.

This patch adds in query a "filter" on "term" which is the most performant way because there must be no ranking computed on this part.

Test plan :
1) Use Elasticsearch
2) Create an autority of type author (NP in UNIMARC) with heading "Tolkien"
3) Create an autority of type subject-author (SAUT in UNIMARC) with heading "Tolkien"
4) Create a biblio record
5) Use tag editor on a author field (700 in UNIMARC)
6) Seach for "Tolkien" in $a
without patch : you see the 2 authorities in results
with patch : you see only the correct authority in results (NP in UNIMARC)
7) Check search in authorities-home.pl is still OK
Comment 2 Jonathan Druart 2019-06-19 01:30:58 UTC
Hi Frido, please provide tests to cover this change :)
Comment 3 Fridolin SOMERS 2019-08-08 06:52:24 UTC
Created attachment 92056 [details] [review]
Bug 23004: Unit test

Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t
Comment 4 Kyle M Hall 2019-09-06 11:02:49 UTC
Created attachment 92632 [details] [review]
Bug 23004: Missing authtype filter in auth_finder.pl

In cataloguing, the use of tag editor opens authorities finder with a limit on specific authorities type.
This limit is missing with Elasticsearch.

This patch adds in query a "filter" on "term" which is the most performant way because there must be no ranking computed on this part.

Test plan :
1) Use Elasticsearch
2) Create an autority of type author (NP in UNIMARC) with heading "Tolkien"
3) Create an autority of type subject-author (SAUT in UNIMARC) with heading "Tolkien"
4) Create a biblio record
5) Use tag editor on a author field (700 in UNIMARC)
6) Seach for "Tolkien" in $a
without patch : you see the 2 authorities in results
with patch : you see only the correct authority in results (NP in UNIMARC)
7) Check search in authorities-home.pl is still OK

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall 2019-09-06 11:19:57 UTC
Created attachment 92634 [details] [review]
Bug 23004: Missing authtype filter in auth_finder.pl

In cataloguing, the use of tag editor opens authorities finder with a limit on specific authorities type.
This limit is missing with Elasticsearch.

This patch adds in query a "filter" on "term" which is the most performant way because there must be no ranking computed on this part.

Test plan :
1) Use Elasticsearch
2) Create an autority of type author (NP in UNIMARC) with heading "Tolkien"
3) Create an autority of type subject-author (SAUT in UNIMARC) with heading "Tolkien"
4) Create a biblio record
5) Use tag editor on a author field (700 in UNIMARC)
6) Seach for "Tolkien" in $a
without patch : you see the 2 authorities in results
with patch : you see only the correct authority in results (NP in UNIMARC)
7) Check search in authorities-home.pl is still OK

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Kyle M Hall 2019-09-06 11:20:06 UTC
Created attachment 92635 [details] [review]
Bug 23004: Unit test

Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Tomás Cohen Arazi 2019-09-09 16:59:31 UTC
Created attachment 92670 [details] [review]
Bug 23004: Missing authtype filter in auth_finder.pl

In cataloguing, the use of tag editor opens authorities finder with a limit on specific authorities type.
This limit is missing with Elasticsearch.

This patch adds in query a "filter" on "term" which is the most performant way because there must be no ranking computed on this part.

Test plan :
1) Use Elasticsearch
2) Create an autority of type author (NP in UNIMARC) with heading "Tolkien"
3) Create an autority of type subject-author (SAUT in UNIMARC) with heading "Tolkien"
4) Create a biblio record
5) Use tag editor on a author field (700 in UNIMARC)
6) Seach for "Tolkien" in $a
without patch : you see the 2 authorities in results
with patch : you see only the correct authority in results (NP in UNIMARC)
7) Check search in authorities-home.pl is still OK

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Tomás Cohen Arazi 2019-09-09 16:59:36 UTC
Created attachment 92671 [details] [review]
Bug 23004: Unit test

Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Martin Renvoize 2019-09-10 08:36:46 UTC
Nice work!

Pushed to master for 19.11.00
Comment 10 Fridolin SOMERS 2019-09-13 12:51:24 UTC
Pushed to 19.05.x for 19.05.04
Comment 11 Lucas Gass 2019-10-17 19:05:57 UTC
backported to 18.11.x for 18.11.11