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 George <em...@gmail.com> on 2009/03/06 19:49:02 UTC

Index an Oracle DATE column with a Solr DateField

Hi,

I've an Oracle DATE column that I want to index with a Solr DateField. The
part of my schema.xml looks like this:

<fieldType name="date" class="solr.DateField" sortMissingLast="true"
omitNorms="true"/>
<field name="plazo" type="date" indexed="true" stored="true" default="NOW"
multiValued="false" />

I use DataImportHandler. When I do a search, this field is returned with one
day before. Oracle: 2006-12-10. Solr: 2006-12-09T23:00:00Z

If I index it as a String, it's indexed as expected (with the same "string
date" as I see it in Oracle)

Does anyone know where the problem is?

Thanks in advance

Re: Index an Oracle DATE column with a Solr DateField

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Sat, Mar 7, 2009 at 12:19 AM, George <em...@gmail.com> wrote:

> Hi,
>
> I've an Oracle DATE column that I want to index with a Solr DateField. The
> part of my schema.xml looks like this:
>
> <fieldType name="date" class="solr.DateField" sortMissingLast="true"
> omitNorms="true"/>
> <field name="plazo" type="date" indexed="true" stored="true" default="NOW"
> multiValued="false" />
>
> I use DataImportHandler. When I do a search, this field is returned with
> one
> day before. Oracle: 2006-12-10. Solr: 2006-12-09T23:00:00Z
>
> If I index it as a String, it's indexed as expected (with the same "string
> date" as I see it in Oracle)
>
> Does anyone know where the problem is?
>

2006-12-10 is equivalent to 2006-12-10T00:00:00 and I would guess that there
is some timezone conversion happening here? Also note that Solr dates are
supposed to be in UTC (refer to date type in schema.xml for a description).
Are you using DateFormatTransformer?

-- 
Regards,
Shalin Shekhar Mangar.