title: Using filters with elasticsearch and tire to mimic named scopes in rails
body: <p>I have an <code>Exhibition</code> model that has three named scopes:</p>
  
  <pre><code>scope :opening, -&gt; { where(start_date: (Date.today .... }
  scope :closing, -&gt; { where(end_date: .... }
  scope :reception, -&gt; { where("reception is not null")... }
  </code></pre>
  
  <p>I have the following tire mapping inside the same model:</p>
  
  <pre><code>tire.mapping do
      ...
      indexes :start_date, type: "date"
      indexes :end_date, type: "date"
      indexes :reception, type: "date"
      ...
  end
  </code></pre>
  
  <p>And my search method:</p>
  
  <pre><code>def self.search(params)
      tire.search(load: true) do
      query { string params[:query] } if params[:query].present?
      ...
  end
  </code></pre>
  
  <p>Inside my <code>exhibitions_controller.rb</code> I have the following (and the same for closing and reception)</p>
  
  <pre><code>def opening_this_week
      @exhibitions = Exhibition.opening.search(params)
      ...
  end
  </code></pre>
  
  <p>When I actually search for one of the indexed fields I get back the correct response of just the exhibitions that meet the query and are opening this week, however, when I want all opening exhibitions and do not pass a search query I get ALL exhibitions, not just those that are opening this week.</p>
  
  <p>What am I doing wrong here? How do I transition from a named scope to a facet? Or should I be doing it as a filter?</p>