Koha-clms/t/db_dependent/Koha
David Gustafsson cbd56aa5fc Bug 24807: [20.05.x] Add "year" type to improve sorting behaviour
Add a "year" search field type. Fields with this type will only
retain values that looks like years, so invalid values such as
whitespace or word characters will not be indexed.
This for instance improves the behaviour when sorting by
"date-of-publication". If all values are indexed, records with
junk data instead of valid years will appear first among the search
results, drowning out more relevant hits. If assigning this field
the "year" type these records will instead always appear last,
regarless of sort order.

To test:

1) Have at least two biblios, one with a valid year in 008 (pos 7-10)
and another with an invalid one ("uuuu" for example)
2) Perform a wildcard search (*) and sort results by publication date.
3) The record with invalid year of pulication in 008 should appear first
4) Apply patch and run database updates
5) Reindex ElasticSearch
6) Perform the same search as in 2)
7) The record with the invalid year should now appear last

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 24807: Add database update script

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 24807: Update tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 24807: Add suppport for uncertain fields and ranges

To test:
1 - Have some records with uncertain dates in the 008
    19uu, 195u, etc.
2 - Index them in Elasticsearch
3 - Do a search that will return them
4 - Sort results by publication/copyright date
5 - Note odd results
6 - Apply patch
7 - Reindex
8 - Sorting should be improved

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 24807: Refactor using tokenize_callbacks

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 24807: Simplify with new and imporved value_callbacks

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 24807: (follow-up) Fix spelling

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 24807: (follow-up) Add support for spaces as unknown characters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 24807: (QA follow-up) Remove uneccessary tests

These tests fail now, the code expects a real response from ES in Indexer.pm
but these tests mock 'bulk' and so don't have the necessary fields.

We are testing the same code above and can just add the _id == biblionumber test

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2020-10-16 14:27:07 +00:00
..
Account Bug 25998: Add Unit Tests 2020-07-28 14:54:29 +00:00
Acquisition Bug 24161: (follow-up) Fix failing test (when running slow) 2020-05-13 16:05:36 +01:00
Biblio
…
BiblioUtils
…
Cash Bug 24815: Add additional tests 2020-04-29 16:17:53 +01:00
Charges Bug 25729: Prevent Charges/Fees.t to fail on slow server 2020-07-31 20:31:51 +00:00
Checkouts
…
Club Bug 23820: Fix Koha/Club/Hold.t 2020-07-27 16:47:38 +00:00
Config
…
Filter
…
IssuingRules
…
Item
…
Library
…
Objects/Mixin
…
Patron Bug 26157: Correct two occurrences 2020-10-09 18:07:43 +00:00
Patrons Bug 18308: (RM follow-up) Fix failing tests 2020-05-05 10:49:07 +01:00
Plugins Bug 18308: (RM follow-up) Clarify intent of tests 2020-05-05 14:59:35 +01:00
REST Bug 26322: Regression tests 2020-09-22 23:12:27 +00:00
SearchEngine Bug 24807: [20.05.x] Add "year" type to improve sorting behaviour 2020-10-16 14:27:07 +00:00
Subscription
…
Tags
…
Template/Plugin Bug 13547: (QA follow-up) Add basic tests 2020-05-12 11:44:52 +01:00
XSLT Bug 25641: Fix Koha/XSLT/Base.t failures on U20 2020-06-16 21:37:46 +00:00
Z3950Responder Bug 25277: Unit test 2020-05-18 15:27:22 +01:00
Account.t
…
ActionLogs.t
…
ApiKeys.t
…
Authorities.t Bug 24823: Drop Catmandu dependency 2020-05-12 11:43:19 +01:00
Biblio.t Bug 25540: Use build_sample_item 2020-05-23 08:33:57 +01:00
BiblioFrameworks.t
…
Biblios.t
…
Checkouts.t
…
CirculationRules.t
…
Cities.t
…
ClassSortRules.t
…
ClassSources.t
…
ClassSplitRules.t
…
CsvProfiles.t
…
Database.t Bug 22001: Add tests 2020-03-27 08:53:02 +00:00
Desks.t Bug 13881: Add desk management 2020-03-25 09:19:15 +00:00
GetDailyQuote.t
…
Holds.t
…
IssuingRules.t
…
Item.t Bug 25421: Make ->pickup_locations only return an arrayref 2020-05-12 10:59:58 +01:00
ItemTypes.t
…
Items.t
…
KeyboardShortcuts.t
…
Libraries.t Bug 24368: Remove Koha::Libraries->pickup_locations 2020-05-13 10:30:41 +01:00
MarcSubfieldStructures.t
…
News.t
…
Notices.t
…
Object.t Bug 25638: Add tests for JSON conversion vs DBD::mysql 2020-06-16 21:47:07 +00:00
Objects.t Bug 24147: Don't assume search_related will return ordered values 2020-09-04 21:51:14 +00:00
Old.t
…
Patron.t Bug 26157: Correct two occurrences 2020-10-09 18:07:43 +00:00
Patrons.t Bug 23495: Fix if no sms provider defined 2020-04-29 16:57:06 +01:00
Ratings.t
…
Reports.t
…
Reviews.t
…
SMS_Providers.t
…
SearchField.t
…
SharedContent.t
…
Statistics.t
…
Subscription.t
…
Suggestion.t
…
Suggestions.t Bug 23591: Add some useful methods to Koha::Suggestions 2020-04-14 16:36:13 +01:00
Tags.t
…
Z3950Servers.t
…