title: Elasticsearch::Transport::Transport::Errors::NotFound: [404]
body: <p>I'm using ElasticSearch as full text engine for my rails pet project app for my <code>Post</code> model. In my <code>posts_controller.rb</code> index action:</p>
  
  <pre><code>    def index
          if params[:query]
              @posts = Post.search(params[:query]).page(params[:page]).records
          else
              @posts = Post.paginate(page: params[:page]).order('created_at DESC')  
          end
      end
  </code></pre>
  
  <p>Where, if a query param is present he should filter the results and present it to the <code>index.html.erb</code>. </p>
  
  <p>What happens is I get </p>
  
  <pre><code>Elasticsearch::Transport::Transport::Errors::NotFound: [404] {"error":"IndexMissingException[[posts] missing]","status":404}
  </code></pre>
  
  <p>I ran the <code>bundle exec rake environment elasticsearch:import:model CLASS='Post'</code> but I still get the same error.</p>
  
  <p>In the words of Marvin Gaye, What's going on?</p>