Ok, so we are talking about DataImportHandler as a client. It looks
like the only (documented) way to correct the timezone in DIH is the
evaluator http://wiki.apache.org/solr/DataImportHandler#formatDate .
However, I am not sure if evaluator can be used inside DIH.

And DateFormatTransformer does not take timezone into account when it
parses the text. A bit of a stuck situation.

I would try one of the following workarounds:
1) Write your own transformer based on DFT and picking up default
timezone setting from somewhere
2) Chain TemplateTransformer either by itself or before the
DateFormatTransformer (not sure if evaluator spits the date out or
not). Either way, I think you should be able to use the formatDate
function in the transformer
3) Create a Jira and wait (possibly for a while....)

Regards,
   Alex.
Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all
at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
book)


On Tue, May 21, 2013 at 5:19 PM, Benjamin Kern <be...@bkern.de> wrote:
> For example:
> original data: 05/13
> Reading:
> <field column=" field " xpath="/xpath " dateTimeFormat="MM/yy"/>
>
> Schema.xml
> <field name=" zielfeld " type="date" indexed="true" stored="true">
>
> Result in Solr: 2013-04-30T22:00:00Z
> I think the date should look like this: 2013-05-01T00:00:00Z
> How can I change this?
>
> Thanks
>
> -----Ursprüngliche Nachricht-----
> Von: Alexandre Rafalovitch [mailto:arafa...@gmail.com]
> Gesendet: Dienstag, 21. Mai 2013 22:45
> An: solr-user@lucene.apache.org
> Betreff: Re: Date Field
>
> This depends on what you use. If you are using SolrJ, it takes the date 
> itself. Other clients, you may need to ensure you use Localized formatter 
> with UTC TimeZone when you generate the text representation of the date. This 
> is a 'client' question, not so much the 'Solr' one.
>
> Regards,
>    Alex.
> Personal blog: http://blog.outerthoughts.com/
> LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
> - Time is the quality of nature that keeps events from happening all at once. 
> Lately, it doesn't seem to be working.  (Anonymous  - via GTD
> book)
>
>
> On Tue, May 21, 2013 at 4:39 PM, Benjamin Kern <be...@bkern.de> wrote:
>> How can I convert the UTC Time?
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Alexandre Rafalovitch [mailto:arafa...@gmail.com]
>> Gesendet: Dienstag, 21. Mai 2013 22:37
>> An: solr-user@lucene.apache.org
>> Betreff: Re: Date Field
>>
>> The date field is stored in UTC, absolute time. You need to convert to and 
>> from UTC in the client/middleware as you see fit.
>>
>> Regards,
>>    Alex.
>> Personal blog: http://blog.outerthoughts.com/
>> LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
>> - Time is the quality of nature that keeps events from happening all
>> at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
>> book)
>>
>>
>> On Tue, May 21, 2013 at 4:31 PM, Benjamin Kern <be...@bkern.de> wrote:
>>> Hi all,
>>>
>>> how can I set the time zone for a date field?
>>>
>>> <field name="field" type="date" indexed="true" stored="true">
>>>
>>>
>>>
>>> Thanks
>>>
>>
>>
>
>

Reply via email to