[ 
https://issues.apache.org/jira/browse/SOLR-2525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13076294#comment-13076294
 ] 

David commented on SOLR-2525:
-----------------------------

Timezone needs to be taken into account when doing date math. Currently it 
isn't. DateMathParser instances created are told to use UTC. This is a huge 
issue when it comes to faceting. Depending on your timezone day-light-savings 
changes the length of a month. A facet gap of +1MONTH is different depending on 
the timezone and the time of the year.

I believe the issue is very simple to fix. There are three places in the code 
DateMathParser created. All three are configured with the timezone being UTC. 
If a user could specify the TimeZone to pass into DateMathParser this faceting 
issue would be resolved.

> Date Faceting or Range Faceting with offset doesn't convert timezone
> --------------------------------------------------------------------
>
>                 Key: SOLR-2525
>                 URL: https://issues.apache.org/jira/browse/SOLR-2525
>             Project: Solr
>          Issue Type: Bug
>          Components: Schema and Analysis, search
>    Affects Versions: 3.1
>         Environment: Solr 3.1 
> Windows 2008 RC2 Server 
> Java 6
> Running on Jetty
>            Reporter: Rohit Gupta
>              Labels: date, facet
>
> I am trying to facet based on date field and apply user timezone offset so 
> that the faceted results are in user timezone. My faceted result is given 
> below,
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
>       <lst name="responseHeader">
>               <int name="status">0</int>
>               <int name="QTime">6</int>
>               <lst name="params">
>                       <str name="facet">true</str>
>                       <str name="q">icici</str>
>                       <str 
> name="facet.range.start">2011-05-02T00:00:00Z+330MINUTES</str>
>                       <str name="facet.range">createdOnGMTDate</str>
>                       <str name="facet.range.end">2011-05-18T00:00:00Z</str>
>                       <str name="facet.range.gap">+1DAY</str>
>               </lst>
>       </lst>
>       <lst name="facet_counts">
>                 <lst name="facet_ranges">
>               <lst name="createdOnGMTDate">
>               <lst name="counts">
>                   <int name="2011-05-02T05:30:00Z">4</int>
>                   <int name="2011-05-03T05:30:00Z">63</int>
>                   <int name="2011-05-04T05:30:00Z">0</int>
>                   <int name="2011-05-05T05:30:00Z">0</int>
>                  ......       
>               </lst>
>               <str name="gap">+1DAY</str>
>               <date name="start">2011-05-02T05:30:00Z</date>
>               <date name="end">2011-05-18T05:30:00Z</date>
>               </lst>
>          </lst>
>       </lst>
>       </response>
> Now if you notice that the response show 4 records for the 2th of May 2011 
> which will fall in the IST timezone (+330MINUTES), but when I try to get the 
> results I see that there is only 1 result for the 2nd why is this happening.
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
>       <lst name="responseHeader">
>               <int name="status">0</int>
>               <int name="QTime">5</int>
>               <lst name="params">
>                       <str name="sort">createdOnGMTDate asc</str>
>                       <str 
> name="fl">createdOnGMT,createdOnGMTDate,twtText</str>
>                       <str 
> name="fq">createdOnGMTDate:[2011-05-01T00:00:00Z+330MINUTES TO *]  </str>
>                       <str name="q">icici</str>
>               </lst>
>       </lst>
>       <result name="response" numFound="67" start="0">
>               <doc>
>               <str name="createdOnGMT">Mon, 02 May 2011 16:27:05+0000</str>
>               <date name="createdOnGMTDate">2011-05-02T16:27:05Z</date>
>               <str name="twtText">#TechStrat615. Infosys (business soln &amp; 
> IT
>                               outsourcer) manages damages with new chairman 
> K.Kamath (ex ICICI
>                               Bank chairman) to begin Aug 21.</str>
>               </doc>
>               <doc>
>               <str name="createdOnGMT">Mon, 02 May 2011 19:00:44+0000</str>
>               <date name="createdOnGMTDate">2011-05-02T19:00:44Z</date>
>               <str name="twtText">how to get icici mobile banking</str>
>               </doc>
>               <doc>
>               <str name="createdOnGMT">Tue, 03 May 2011 01:53:05+0000</str>
>               <date name="createdOnGMTDate">2011-05-03T01:53:05Z</date>
>               <str name="twtText">ICICI BANK LTD, L. M. MIRAJ branch in 
> SANGLI,
>                               MAHARASHTRA. IFSC Code: ICIC0006537, MICR
>                 Code: ...
>                               http://bit.ly/fJCuWl #ifsc #micr #bank</str>
>               </doc>
>               <doc>
>               <str name="createdOnGMT">Tue, 03 May 2011 01:53:05+0000</str>
>               <date name="createdOnGMTDate">2011-05-03T01:53:05Z</date>
>               <str name="twtText">ICICI BANK LTD, L. M. MIRAJ branch in 
> SANGLI,
>                               MAHARASHTRA. IFSC Code: ICIC0006537, MICR
>                             Code: ...
>                               http://bit.ly/fJCuWl #ifsc #micr #bank</str>
>               </doc>
>               <doc>
>               <str name="createdOnGMT">Tue, 03 May 2011 08:52:37+0000</str>
>               <date name="createdOnGMTDate">2011-05-03T08:52:37Z</date>
>               <str name="twtText">RT @nice4ufan: ICICI BANK PERSONAL LOAN 
> http://ee4you.blogspot.com/2011/04/icici-bank-personal-loan.html    </str>
>               </doc>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to