[Koha-bugs] [Bug 14861] Accession date comparison does not work in advanced search

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Sep 29 13:56:45 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14861

--- Comment #7 from Barton Chittenden <barton at bywatersolutions.com> ---
(In reply to David Cook from comment #3)
> (In reply to Barton Chittenden from comment #2)
> > Ok, this is from my ccl.properties:
> > 
> > Date-of-acquisition 1=32
> > Date-of-acquisition 1=Date-of-acquisition r=o
> > acqdate Date-of-acquisition
> > 
> > Given an item where acqdate is 2011-09-07,
> > 
> >   search.pl?idx=acqdate%2Cst-date-normalized&q=2011-09-07
> > 
> > works, but querying the entire month from 2011-09-01 to 2011-09-30 does not:
> > 
> >   search.pl?idx=acqdate%2Cst-date-normalized&q="2011-09-01+-+2011-09-30"
> > 
> > Returns no results.
> 
> Barton, are you using the advanced search or the regular search box? It
> looks like the advanced search to me.
> 
> The problem I see is that your query is being wrapped in double quotation
> marks.
> 
> No results:
> /cgi-bin/koha/catalogue/search.pl?idx=acqdate%2Cst-date-normalized&q="2010-
> 01-01+-+2015-01-01"&idx=kw&idx=kw&sort_by=relevance
> 
> Lots of results:
> /cgi-bin/koha/catalogue/search.pl?idx=acqdate%2Cst-date-normalized&q=2010-01-
> 01+-+2015-01-01&idx=kw&idx=kw&sort_by=relevance
> 
> Here are two examples of it working in the staff client and opac when using
> free-form CCL queries:
> /cgi-bin/koha/catalogue/search.pl?q=acqdate%2Cst-date-normalized%3A2010-01-
> 01+-+2015-01-01
> /cgi-bin/koha/opac-search.pl?q=acqdate%2Cst-date-normalized%3A2010-01-01+-
> +2015-01-01&branch_group_limit=
> 
> --
> 
> I've seen this sort of problem before on Bywater Koha sites...
> 
> I just tried using the Advanced Search in Koha master and I got the
> following URL, which matches my working URL above.
> /cgi-bin/koha/catalogue/search.pl?idx=acqdate%2Cst-date-normalized&q=2010-01-
> 01+-+2015-01-01&idx=kw&idx=kw&sort_by=relevance
> 
> Are you trying this query on the Koha used by Bywater or the Koha master
> branch? I'm guessing Bywater has a local patch which quotes values and
> that's creating the problem.
> 
> I'm going to poke around a bit more with yaz-client to see if I can find out
> more...

Actually, I put the quotes in the URL by hand. When I search using the advanced
search screen, the CCL query

acqdate,st-date-normalized=2010-01-01 - 2015-01-01

Is parsed to

  
search.pl?idx=kw&q=acqdate%2Cst-date-normalized%3D2010-01-01+-+2015-01-01&op=and&idx=kw&op=and&idx=kw&sort_by=relevance

And 

acqdate,st-date-normalized="2010-01-01 - 2015-01-01"

becomes

  
search.pl?idx=kw&q=acqdate%2Cst-date-normalized%3D%222010-01-01+-+2015-01-01%22&op=and&idx=kw&op=and&idx=kw&sort_by=relevance

I was essentially trying to short-circuit the parser by composing the URLs by
hand.

The quotes in the URL are a red herring anyway:

Neither

  search.pl?idx=acqdate%2Cst-date-normalized&q="2011-09-01+-+2011-09-30"

nor

  search.pl?idx=acqdate%2Cst-date-normalized&q=2011-09-01+-+2011-09-30

return results.

I'm going to try applying this patch to master to see if I get different
results.

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


More information about the Koha-bugs mailing list