You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Mahesh Udupa <ma...@gmail.com> on 2008/03/07 07:10:55 UTC

What is default Date time format in Solr

Hi all,

I heard Solr Date time format is 24 hours.
But I have following query regarding Search time.


In database I have a content with time as :- 2007-12-31 22:29:59

In oder to get this content I tried with following Range query:-

emf.artist:[2007-12-31T22:20:00Z TO  2007-12-31T22:39:00Z]

I am not able to get the content what I expected.

But, I tried with following query:-

emf.artist:[2007-12-31T10:20:00Z TO  2007-12-31T10:39:00Z]

It is perfectly working fine.

My Schema.xml content for Date field is like this :-

<fieldType name="date" class="solr.DateField" sortMissingLast="true"
omitNorms="true"/>

Solrconfig.xml


 <!-- This is an example of using Date Math to specify a constantly
          moving date range in a config...
       -->
     <str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str>


Could you please let me know how can I search a content with 24 Hour format?

Looking forward hearing from u soon

Thanks in advance

-kmu

Re: What is default Date time format in Solr

Posted by Mahesh Udupa <ma...@gmail.com>.
Thanks Chris,

My index creation was wrong ;)(I was using 12 Hour format)

Thanks for your support
-kmu

On Sat, Mar 8, 2008 at 1:35 AM, Chris Hostetter <ho...@fucit.org>
wrote:

>
> : I heard Solr Date time format is 24 hours.
>
> that is correct.
>
> : emf.artist:[2007-12-31T22:20:00Z TO  2007-12-31T22:39:00Z]
> :
> : I am not able to get the content what I expected.
> :
> : But, I tried with following query:-
> :
> : emf.artist:[2007-12-31T10:20:00Z TO  2007-12-31T10:39:00Z]
>
> Is your emf.artist field stored?
> If so what value do you see in the field when you do that second query and
> get the results you are looking for?  if they don't match what you think
> they should be, then the code you have reading dates from your index and
> writing them to Solr isn't doing what you think it's doing.
>
>
>
>
> -Hoss
>
>

Re: What is default Date time format in Solr

Posted by Chris Hostetter <ho...@fucit.org>.
: I heard Solr Date time format is 24 hours.

that is correct.

: emf.artist:[2007-12-31T22:20:00Z TO  2007-12-31T22:39:00Z]
: 
: I am not able to get the content what I expected.
: 
: But, I tried with following query:-
: 
: emf.artist:[2007-12-31T10:20:00Z TO  2007-12-31T10:39:00Z]

Is your emf.artist field stored?  
If so what value do you see in the field when you do that second query and 
get the results you are looking for?  if they don't match what you think 
they should be, then the code you have reading dates from your index and 
writing them to Solr isn't doing what you think it's doing.




-Hoss