Bug 25378 - Fix search on publication date in elasticsearch
Summary: Fix search on publication date in elasticsearch
Status: RESOLVED DUPLICATE of bug 24559
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Julian Maurice
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-05 12:35 UTC by Julian Maurice
Modified: 2020-05-29 06:11 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 25378: Fix search on publication date in elasticsearch (2.23 KB, patch)
2020-05-05 12:36 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2020-05-05 12:35:22 UTC

    
Comment 1 Julian Maurice 2020-05-05 12:36:13 UTC
Created attachment 104361 [details] [review]
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
Comment 2 Katrin Fischer 2020-05-05 20:15:53 UTC
Hi Julian, not sure, but is this related to bug 24559?
Comment 3 Julian Maurice 2020-05-06 06:35:58 UTC
(In reply to Katrin Fischer from comment #2)
> Hi Julian, not sure, but is this related to bug 24559?

Yes, totally. Bug 24599 looks like a better alternative.
Closing as duplicate, thanks Katrin.

*** This bug has been marked as a duplicate of bug 24559 ***