:     I've used this configuration to my timestamp field and it's works
: 
: <field name="timestamp" type="date" indexed="true" stored="true"
: default="NOW+1HOUR" multiValued="false"/>

that is *really* not a good idea ... 

doing something like that means you will be putting incorrect data into 
your index, saying a doc was added an hour lafter it realy was, and 
assuming that later when clients query your index they will just 
implicitly understand that the Date they get back in UTC is wrong 
and should be interpreted in a differnet way with a 1 hour "fudge factor" 
that will be even more wrong and more confusing anytime DST happens

 * Solr indexes contain dates formatted in UTC
 * Client's know their own TZ, and should read/write Date values Solr 
formated in UTC

: Anyway, I would like to know possible configuration of TZ parameter. When  you
: speak "clients can specify a "TZ" param", this means it is possible configure
: TZ parameter using solrconfig.xml or schema.xml files ??

it's not a configuration option, it's a query param that be used in 
requests where DateMath is involved.  so to find all documents indexed 
"yesterday" according to the conventions of when a day starts in the 
"Europe/Madrid" TimeZone, you can do a request like...

  q=myField:[NOW-1DAY/DAY TO NOW/DAY]&TZ=Europe/Madrid

...and the *rounding* will be done realtive the specified timezone, but 
the Dates in the response will still be formated in UTC -- Solr can't 
assume that the client is also in Europe/Madrid, or that the client will 
understand what TZ an ambigious DateTime value of "2013-03-06T12:00:00" is 
in .. that's why the values are explicitly in UTC: "2013-03-06T12:00:00Z" 
(note the "Z" suffix)



-Hoss

Reply via email to