On 2/2/07, Michael Kimsal <[EMAIL PROTECTED]> wrote:
I'm having a devil of a time getting date seaching to work properly. I've
created a 'date' field in my schema, and I put values like
"2005-08-01T23:59:59Z" in it.
However, when I run the following search
foobar date:[2005-08-01T00:00:00Z TO 2005-08-01T23:59:59Z]
I get values back that do not have a date value in the 08/01/2005 range.
Hmmm, we need to get an easy update form committed so this stuff becomes
easier to test. Anyway, here is a little test program that uses the
python client:
from solr import *
c = SolrConnection(host='localhost:8983')
c.add(id='500',a_dt='2005-08-01T23:59:59Z')
c.commit();
print c.search(q='a_dt:"2005-08-01T23:59:59Z"')
print c.search(q='a_dt:["2005-08-01T00:00:00Z" TO "2005-08-01T23:59:59Z"]')
Note that without the quotes around the date in the range query, I get
an exception because the ':' causes the value to be truncated by the
queryparser.
-Yonik