title: Ruby: ElasticSearch + Tire error Tire::Search::SearchRequestFailed - IndexMissingException?
body: <p>I want to use ElasticSearch + Tire to search stored in MongoDB.</p>
  
  <p>However, I'm getting the following error when I try to perform a search:</p>
  
  <p><strong>Tire::Search::SearchRequestFailed in SearchController#index</strong></p>
  
  <pre><code>404 : {"error":"IndexMissingException[[events] missing]","status":404}
  </code></pre>
  
  <p>From what I understand, this tells me that the indexes are missing for the Event, even though I've told it to generate them when I ran <code>db:setup</code>.</p>
  
  <p>Model:</p>
  
  <pre><code>class Event
    include Mongoid::Document
    include Mongoid::Timestamps 
  
    include Tire::Model::Search
    include Tire::Model::Callbacks
  
    field :name, :type =&gt; String
    field :description, :type =&gt; String
    field :started_at =&gt; Time
    field :ended_at =&gt; Time
  
    def to_indexed_json
      self.as_json
    end
  end
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>  def search
      Event.tire.search(params[:q])
    end
  </code></pre>
  
  <p>Any ideas on how to resolve this please?</p>