Bug 11293 - QueryParser date filters do not handle full dates well
Summary: QueryParser date filters do not handle full dates well
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 12742
  Show dependency treegraph
 
Reported: 2013-11-23 20:29 UTC by Galen Charlton
Modified: 2020-11-30 21:45 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:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.