Date range problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Date range problem

Stu Hood-2
Hello,

Searching by date ranges doesn't seem to work in the example Solr install. A query like `timestamp:[20070101 TO 20080101]` returns:

message Invalid Date String:'20070101'

description The request sent by the client was syntactically incorrect (Invalid Date String:'20070101').

That query should be valid according to http://lucene.apache.org/java/docs/queryparsersyntax.html#Range%20Searches

Any ideas?

Stu Hood
Webmail.us
"You manage your business. We'll manage your email."®
Reply | Threaded
Open this post in threaded view
|

Re: Date range problem

mgkimsal
I've only been able to get date/time stuff to work when the entire full
date/time format is used

2007-05-30T12:34:56Z

Or is there a +0000 in there too?

On 6/25/07, Stu Hood <[hidden email]> wrote:

>
> Hello,
>
> Searching by date ranges doesn't seem to work in the example Solr install.
> A query like `timestamp:[20070101 TO 20080101]` returns:
>
> *message* *Invalid Date String:'20070101'*
>
> *description* *The request sent by the client was syntactically incorrect
> (Invalid Date String:'20070101').*
> That query should be valid according to
> http://lucene.apache.org/java/docs/queryparsersyntax.html#Range%20Searches
>
> Any ideas?
>
> Stu Hood
> Webmail.us
> "You manage your business. We'll manage your email."(r)
>



--
Michael Kimsal
http://webdevradio.com
Reply | Threaded
Open this post in threaded view
|

Re: Date range problem

Ryan McKinley
In reply to this post by Stu Hood-2
the solr date format is a bit more strict (ISO 8601)

yyyy-MM-dd'T'HH:mm:ss.SSS

there is talk of a more lienent date parser, but nothing exists yet..

The format you suggest would be ok if you index your dates as a string
'20070101' and then use a range query.




Stu Hood wrote:

> Hello,
>
> Searching by date ranges doesn't seem to work in the example Solr
> install. A query like `timestamp:[20070101 TO 20080101]` returns:
>
> *message* _Invalid Date String:'20070101'_
>
> *description* _The request sent by the client was syntactically
> incorrect (Invalid Date String:'20070101')._
>
> That query should be valid according to
> http://lucene.apache.org/java/docs/queryparsersyntax.html#Range%20Searches
>
> Any ideas?
>
> Stu Hood
> Webmail.us
> "You manage your business. We'll manage your email."®

Reply | Threaded
Open this post in threaded view
|

Re: Date range problem

Stu Hood-2
In reply to this post by Stu Hood-2
Ok, the full time format works fine (and quickly too). Thanks for the quick answers!

Stu


-----Original Message-----
From: Ryan McKinley
Sent: Mon, June 25, 2007 1:19 pm
To: [hidden email]
Subject: Re: Date range problem

the solr date format is a bit more strict (ISO 8601)

yyyy-MM-dd'T'HH:mm:ss.SSS

there is talk of a more lienent date parser, but nothing exists yet..

The format you suggest would be ok if you index your dates as a string
'20070101' and then use a range query.




Stu Hood wrote:

> Hello,
>
> Searching by date ranges doesn't seem to work in the example Solr
> install. A query like `timestamp:[20070101 TO 20080101]` returns:
>
> *message* _Invalid Date String:'20070101'_
>
> *description* _The request sent by the client was syntactically
> incorrect (Invalid Date String:'20070101')._
>
> That query should be valid according to
> http://lucene.apache.org/java/docs/queryparsersyntax.html#Range%20Searches
>
> Any ideas?
>
> Stu Hood
> Webmail.us
> "You manage your business. We'll manage your email."®