Bug 11293 - QueryParser date filters do not handle full dates well
Summary: QueryParser date filters do not handle full dates well
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on: 12742
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-23 20:29 UTC by Galen Charlton
Modified: 2014-08-10 13:13 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


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