[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
Wed Sep 30 07:03:30 CEST 2015


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

--- Comment #9 from David Cook <dcook at prosentient.com.au> ---
(In reply to Barton Chittenden from comment #7)
> The quotes in the URL are a red herring anyway:
> 

I can assure you that they're not. The quotes are a problem too.

> 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.

Well, that's rather strange. It's definitely working on a number of 3.14
installs.

Hmm... you're right... it's not working in master. It seemed to be working when
I had an acqdate with 2011-09-01, but then I changed it to 2011-09-02 in the
item, and now it's clearly not working.

The query works in yaz-client, so it's clear that Koha is doing something
naughty.

*looks at the logs*

Holy... Barton, I think you've uncovered a much larger bug.

Let me guess... you're not using the first box in the advanced search, are you?

It works for me when I use the first box as "Acquisition date (yyyy-mm-dd)",
but if I leave the first two boxes as "Keyword" and I use the third box as
"Acquisition date (yyyy-mm-dd)", it won't work. 

Check your logs to see what's actually coming out of buildQuery.


--

Also, a note on your first comment:

Results of search for 'acqdate,st-date-normalized: >2015-08-01'
No results found!

If you check your logs, you'll see that it says the following:

WARNING: query problem with acqdate,st-date-normalized=> 2011-08-01  ZOOM error
10014 "CCL parsing error" (addinfo: "Bad relation") from diag-set 'ZOOM'

While the documentation uses "yr,st-numeric=>2000", that's actually a bad
example as it produces the same error:

WARNING: query problem with yr,st-numeric=>2000 ZOOM error 10014 "CCL parsing
error" (addinfo: "Bad relation") from diag-set 'ZOOM'

I keep meaning to re-write the search documentation for Koha... it's really not
very accurate...

You know what would work in Koha?

ccl=acqdate,st-date-normalized > 2011-08-30

Or in yaz-client:
acqdate,st-date-normalized > 2011-08-30


The relation doesn't work properly in Koha, because we're not parsing the query
properly. "buildQuery" is a nightmare which butchers queries and turns them
into pseudo-CCL.

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


More information about the Koha-bugs mailing list