Bug 11293

Summary: QueryParser date filters do not handle full dates well
Product: Koha Reporter: Galen Charlton <gmcharlt>
Component: SearchingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: katrin.fischer, rudolfbyker
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 12742    

Description Galen Charlton 2013-11-23 20:29:33 UTC
The date filter callback for handling date filters does not handle full dates correctly.  For example,

* pubdate(2011-) signifies searching for records published on or after 2011
* pubdate(-1997) signifies searching for records published before or on 1997
* pubdate(1997-1999) signifies searching for records published in the applicable range

However, since the hyphen is used to split elements of the range, the parsing does not currently handle full dates, e.g.:

* acqdate(-2013-11-21) (items acquired on or before 2013-11-21)
* acqdate(2013-01-01-2013-02-26) (items acquired during the specified range

As a consequence, when QueryParser is enabled, using the acquisition date filters in the labels add-items-to-batch search form does not work.  This likely accounts for the difficulty that Owen had when attempting to test the patch for bug 11222.

For example, the QP query "acqdate(-2013-11-29)" gets sent to Zebra as

@attrset Bib-1 @and @attr 2=4 @attr 1=Date-of-acquisition @attr 4=4 -2013-11 @attr 2=2 @attr 1=Date-of-acquisition @attr 4=4 29

when what was meant was:

@attrset Bib-1 @attr 1=Date-of-acquisition @attr 4=5 @attr 2=2 2013-11-29
Comment 1 Katrin Fischer 2020-02-24 20:50:02 UTC
We've voted to remove the QueryParser code (https://wiki.koha-community.org/wiki/Development_IRC_meeting_4_March_2020), so I am closing this WONTFIX.