On 4/8/2019 4:38 AM, Miettinen Jaana (STAT) wrote:
I have a problem in solr: I should add several (old) time stamps into my solr 
documents, but all of them are in  local time (UTC+2 or UTC+3 depending on 
day-light-saving situation). As default solr excepts all time stamps to be in 
UTC-time and adds the 'Z'-character into the end of the time stamp-strings to 
indicate, that the date should be considered as UTC-time.

Is it possible to change this 'Z'-notation ? Either I would want to get rid of 
that 'Z' or change it to denote UTC+2.

Solr uses UTC. The "Z" is part of the ISO standard that Solr is using. I forget which ISO number it is. So it's always going to be there when using a date field.

I noticed that there's variable SOLR_TIMEZONE in solr-7.6.0/bin/solr.in.sh-file. I 
changed it to  SOLR_TIMEZONE="EST", re-created my solr-servers, but nothing 
changed. Why was that configuration file ignored (I also changed the port to check 
whether it was ignored really) ? And what is the purpose of  SOLR_TIMEZONE-variable ?


The timezone information affects date math. So when you have something like NOW/WEEK or NOW/DAY, Solr knows when a new day starts and can round the time correctly.

Timezone information does *NOT* affect the time that does into the index or the display of information in search results.

If you want your local timezone in your output, you're going to need to do what programs on UNIX have been doing for decades -- translating the UTC time they can access to the configured timezone. It is rare for Solr's results to be given directly to users -- it nearly always passes through a custom program.

Thanks,
Shawn

Reply via email to