Lucene's OffsetTime codec may incorrectly encode the indexed value leading to unexpected results during aggregation

Description

having a query like

var hits = searchSession.search( Book.class ) .select( f -> f.field( "authors.time", OffsetTime.class ).multi() ) .where( f -> f.matchAll() ) .aggregation( key, f -> f.terms().field( "authors.time", OffsetTime.class ) ) .fetch( 20 );

where

@GenericField(projectable = Projectable.YES, aggregable = Aggregable.YES) OffsetTime time;

and using a few test values

LocalTime.of( 1, 1 ), ZoneOffset.ofHours( 10 ) LocalTime.of( 1, 1 ), ZoneOffset.ofHours( 5 )

Results in

aggregationResults={AggregationKey[agg]= { 15:01Z=3, 20:01Z=1 } }

but the times should’ve been

aggregationResults={AggregationKey[agg]= { 11:01Z=3, 06:01Z=1 } }

Activity

Show:

Marko Bekhta July 5, 2024 at 3:30 PM

My date-time-zone math was wrong here. Closing the issue as rejected, as there's obviously no need for a fix

Rejected

Details

Assignee

Reporter

Components

Affects versions

Priority

Created July 5, 2024 at 2:42 PM
Updated July 5, 2024 at 3:30 PM
Resolved July 5, 2024 at 3:30 PM

Flag notifications