lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ufuk yılmaz <>
Subject Range faceting on timestamp field
Date Thu, 24 Dec 2020 21:42:40 GMT
Hello all,

I have a plong field in my schema representing a Unix timestamp

<field name="timestamp_s" type="plong" indexed="true"/>

I’m doing a range facet over this field to find which event occured on which day. I’m
setting “start” on some date at 00:00 o’clock, end on another, and setting gap to 86400
(total seconds in a day)
"type": "range",
"field": "timestamp_s",
"start": 1338498000,
"end": 1339275600,
"gap": 86400,

Lets say that an event occured at 19:00 GMT+00. This facet puts it in the bucket of that day,
which starts at 00:00. I’m living in GMT+2 timezone, so clock was 21:00 and that event occured
on the same day with me, which is all good and correct.

Another event occured at 23:00 GMT+00, Day 2. At that time, it was 01:00 Day 3 here. Faceting
puts the event at Day 2 00:00’s bucket, when converted to my timezone, puts the event on
Day 2. But it was Day 3 here when the event happened...

I wish I didn’t bore the hell out of you. Do you have any suggestion to solve this problem?
Unfortunately my timestamp field is not a date field and I need to show the results from my
perspective, not from the universal time.

Have a nice day!

Sent from Mail for Windows 10

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message