sorting - Sort by max value of nested fields filtered by range -


here structure:

i have place object , nested timeslots 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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -