Bugzilla – Attachment 166951 Details for
Bug 36902
Blank year fields should not be indexed.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36902: Filter year fields containing blanks
Bug-36902-Filter-year-fields-containing-blanks.patch (text/plain), 1.81 KB, created by
Andreas Jonsson
on 2024-05-21 07:32:37 UTC
(
hide
)
Description:
Bug 36902: Filter year fields containing blanks
Filename:
MIME Type:
Creator:
Andreas Jonsson
Created:
2024-05-21 07:32:37 UTC
Size:
1.81 KB
patch
obsolete
>From 1bb963d34fab5954559c538e46e9dbd97b554de9 Mon Sep 17 00:00:00 2001 >From: Andreas Jonsson <andreas.jonsson@kreablo.se> >Date: Tue, 21 May 2024 09:29:29 +0200 >Subject: [PATCH] Bug 36902: Filter year fields containing blanks > >Test plan: > >* If you are using koha-testing-docker, make sure that you have an elasticsearch container > running (e.g., ku-es7) and that the searchengine system preference is set to > ElasticSearch, and that the indexer is running (koha-es-indexer --start kohadev). >* Under Koha administration -> Search engine configuration, make sure that the > type of the field date-of-publication is set to 'year'. >* If you needed to changed the type above, rebuild the index: > koha-elasticsearch --delete --rebuild kohadev >* Edit any record and change control field 008 position 7-10 (Date 1) to all blanks. >* Save the record. >* Show the elasticsearch record (Klick on "Show" in Elasticsearch record: Show") >* Make sure there are no value "0000" for date-of-publication. >* Edit the record again and change control field 008 position 7-10 (Date 1) to valid year. >* Save the record. >* Show the elasticsearch record. >* Make sure there set year is present in the field date-of-publication. >--- > Koha/SearchEngine/Elasticsearch.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 531d410e5b..f3e035df19 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -1011,7 +1011,7 @@ sub _field_mappings { > push @{$default_options->{value_callbacks}}, sub { > my ($value) = @_; > # Replace "u" with "0" for sorting >- return map { s/[u\s]/0/gr } ( $value =~ /[0-9u\s]{4}/g ); >+ return map { /[0-9u]{4}/g } ( $value =~ s/u/0/gr ); > }; > } > >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36902
:
166951
|
167065