Date range query in SearchKick (elastic search)
<p>I have a Rails 5 app that lists a collection of events. I have SearchKick set up nicely and I am now trying to add functionality that only displays the events from today onwards but I'm struggling with the implementation. I currently have the following:</p>

<p><code>events_controller.rb</code></p>

<pre><code>class EventsController &lt; ApplicationController

    def index
      query = params[:j].presence || "*"
      conditions = {}
      conditions[:sector_name] = params[:sector_name] if params[:sector_name].present?
      conditions[:service_name] = params[:service_name] if params[:service_name].present?
      conditions[:start_date] = params[:start_date] if params[:start_date].present?
      @events = Event.search query, where: conditions, aggs: [:sector_name, :service_name], range: {start_date: {"gte": "now/d"}}, order: {start_date: {order: "asc", unmapped_type: "long"}}, page: params[:page], per_page: 10
    end
  ...
end
</code></pre>

<p><code>start_date</code> is of <code>date</code> type in my postgres db.</p>

<p>When I go to <code>index.html.erb</code> I'm still seeing events with a <code>start_date</code> before today's date.</p>