: We use Solr1.3 and indexed some of our date fields in the format
: '1995-12-31T23:59:59Z' and as we know this is a UTC date. But we do want to
: index the date in IST  which is +05:30hours so that extra conversion from
: UTC to IST across all our application is avoided.

There's no way to do this with Solr/DateField right now -- in general we 
don't want Solr to have to make any assumptions about what timezone the 
client is in, and we don't want the client to have to know what timezone 
the server is in -- that's why we deal with UTC.  The clients all only 
need to know their own timezone to parse/format the date properly.

if you really want this handled on the server side, you could write an 
UpdateProcessor to deal with this.

: 2) And we have some confusion on how the flexible search functions such as
: (NOW, NOW+1DAY etc) provided by DateMathParser works? Now() is being
: calculated upon considering the date indexed as  UTC or  Localtime? Can we
: have the NOW() results in IST if the date indexed is in IST?

"as  UTC or  Localtime" is meaningless in the context of when "NOW" is.  
TimeZones and Locale (UTC, IST, your localtimezone, etc...) only affect 
parsing, formatting, and rounding of date values. NOW means "this moment 
in time" which is agnostic to what you do with it.

When you start rounding date values (ie: NOW/DAY) that is relative UTC.  

(It would be nice if the client could specify timezone info in the request 
for the purposes of DateMath rounding, but there isn't an easy way for 
that info to be passed into theDateField methods)

Something i've seen people do to get dates rounded to a particular 
timezone is to add the offset for that timezone after rounding, but that 
doesn't take into account daylight savings time...

   start:[NOW/DAY+5HOUR+30MIN TO *]




-Hoss

Reply via email to