sorting - Sort by max value of nested fields filtered by range -
here structure:
i have place
object , nested timeslot
s each timeslot
have discount amount.
i want sort places maximum discount amount filtered time range.
here sorting function
:sort => [ { :"week_time_slots.discount_amount" => { :order => "desc", :mode => "max", :nested_filter => { :range => { :"week_time_slots.time" => { :gte => tue, 25 jul 2017 17:00:00, :lte => tue, 25 jul 2017 18:00:00 } } } } } ]
it seems filter not affect sorting function expect. have places in first place without slots in provided range.
Comments
Post a Comment