[Zebralist] Searching on date (range) in zebra

Merijn van den Kroonenberg merijn at web2all.nl
Fri Feb 29 14:56:58 CET 2008


Hello,

I have some problems when searching on a date range in zebra.

My testcase searches between 2007-10-28 00:00:00 and 2007-10-29 23:59:59. 
This gives zero results. However this period does contain documents which 
should have been found.
If i search for documents after 2007-10-28 00:00:00 I get 92 hits (and it 
shows some actual results which should have been found in the range search).
If I search before 2007-10-29 23:59:59 I get 10732 hits.

If I search before 2007-10-29 23:59:59 and combine the search with a title 
search on a subject that occurs in the 2007-10-28 00:00:00 / 2007-10-29 
23:59:59 range, I do not find those. It actually gets only 2 hits, which are 
both old dates.

I get the impression that the date subquery gets truncated if there are alot 
of results. (at least it seems to behave this way)

Does anyone have an idea if i am doing something wrong, or if this is a 
known issue in my version (2.0.18)? Or maybe I handle the date search wrong?
I have the Date-of-publication field indexed as a date index and I filled it 
with YYYY-MM-DD HH:MM:SS formatted datetime. I couldn't find an actual 
example, so maybe this is not valid for an date index?

Below are some of the different queries I executed.

because of the long lines i put this entire e-mail online, which may be 
easier to read:
http://www.web2all.nl/datequestion/question.txt

I also put some of the pdu logs online (see below).

Search for everything after 2007-10-28 00:00:00:
@attr 1=31 @attr 2=4 @attr 4=5 {2007-10-28 00:00:00}
Result Count 92
<record xmlns="http://www.indexdata.com/zebra/" sysno="17459" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="149">2007-10-28 20:49:24</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="17460" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="104">2007-10-28 20:49:56</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="17461" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="23">2007-10-28 21:43:54</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="17462" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="3309">2007-10-28 21:53:10</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="17463" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="921">2007-10-28 23:32:09</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="17464" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="165">2007-10-28 23:46:45</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="17465" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="406">2007-10-29 08:44:21</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="17466" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="273">2007-10-29 08:59:24</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="17467" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="5142">2007-10-29 12:24:28</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="17468" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="413">2007-10-29 15:59:45</index> </record>
..
http://www.web2all.nl/datequestion/pdu.log.19009.txt

Search for everything before 2007-10-29 23:59:59:
@attr 1=31 @attr 2=2 @attr 4=5 {2007-10-29 23:59:59}
Result Count 10732
<record xmlns="http://www.indexdata.com/zebra/" sysno="13490" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="124">2007-03-15 11:20:32</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="13491" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="311">2007-03-15 11:33:40</index> </record>
..
http://www.web2all.nl/datequestion/pdu.log.19010.txt

Search for everything between 2007-10-28 00:00:00 and 2007-10-29 23:59:59
@and @attr 1=31 @attr 2=4 @attr 4=5 {2007-10-28 00:00:00} @attr 1=31 @attr 
2=2 @attr 4=5 {2007-10-29 23:59:59}
Result Count 0
http://www.web2all.nl/datequestion/pdu.log.19011.txt

Two more searches before 29th and 28th, both giving same number of results 
(should not be possible):
@attr 1=31 @attr 2=2 @attr 4=5 {2007-10-29 00:00:00}
Result Count 10732
<record xmlns="http://www.indexdata.com/zebra/" sysno="13490" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="124">2007-03-15 11:20:32</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="13491" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="311">2007-03-15 11:33:40</index> </record>
..

@attr 1=31 @attr 2=2 @attr 4=5 {2007-10-28 00:00:00}
Result Count 10732
<record xmlns="http://www.indexdata.com/zebra/" sysno="13490" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="124">2007-03-15 11:20:32</index> </record>
<record xmlns="http://www.indexdata.com/zebra/" sysno="13491" 
set="zebra::index::Date-of-publication/"> <index name="Date-of-publication" 
type="d" seq="311">2007-03-15 11:33:40</index> </record>
..

Thanks,

Merijn

Web2All B.V.
Telefoon: +31 475 775511
Fax:        +31 475 338290
Email:      merijn at web2all.nl
Website:  http://www.web2all.nl




More information about the Zebralist mailing list