[Koha-bugs] [Bug 25378] Fix search on publication date in elasticsearch

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 5 14:36:13 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25378

--- Comment #1 from Julian Maurice <julian.maurice at biblibre.com> ---
Created attachment 104361
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=104361&action=edit
Bug 25378: Fix search on publication date in elasticsearch

Index 'date' fields as integer so that a query like

    copydate:[1900 TO *]

works correctly

Malformed values (values that are not integer) will be ignored by
elasticsearch

Test plan:
1. Create two biblios, one with a valid year in the copydate field, one
   with an invalid year. The copydate field depends on your configuration
   (by default it's 260$c for MARC21 and NORMARC)
   Valid value example: "2301"
   Invalid value example: "year 2301"
2. Run `misc/search_tools/rebuild_elasticsearch.pl -b -d`
3. Go to OPAC advanced search, and in the "Publication date range"
filter, type: "2301", you should get only one result (the "valid"
biblio)
4. Try the following searches:
    - "2301-2301"
    - "2300-2302"
    - "2300-"
   They should all return the valid biblio
5. Try "2302-". You should get no results
6. Do the same at staff interface

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list