lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulul <had...@ulul.org>
Subject DateRangeField and Timezone
Date Thu, 20 Jul 2017 00:10:53 GMT
Hi everyone

I'm trying to query on dates with time zone taken into account. I have
the following document

{"date" : "2016-12-31T04:15:00Z", "desc" : "winter time day before" }
date being of type DateRangeField

I would like to be able to perform a query based on local date. For
instance the above date corresponds to 2016-12-30 in New York (UTC-5 in
winter) so I would expect the following query NOT to retrieve the document :

http://127.0.1.1:7574/solr/date_test/select?TZ=America/New_York&indent=on&q=date:2016-12-31&wt=json

Unfortunately it does... and it's the same using filter query

https://cwiki.apache.org/confluence/display/solr/Working+with+Dates
describes how to use TZ in facets, why doesn't it work with simple queries ?

I'm using Solr 6.5.1

I had to add DateRangeField type myself to the collection schema. I did
it with :

curl -X POST -H 'Content-type:application/json' --data-binary '{
  "add-field-type" : {
     "name":"DateRangeField",
     "class":"solr.DateRangeField"
  }
}' http://localhost:7574/solr/date_test/schema

Thank you for your help

Ulul


Mime
View raw message