Elasticsearch :: Transport :: Transport :: Errors :: NotFound: [404]
I am using ElasticSearch as full text engine for my rails pet project for my model Post
. In my index action posts_controller.rb
:
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
Where, if a query parameter is present, it should filter the results and present them in index.html.erb
.
What happens I get
Elasticsearch::Transport::Transport::Errors::NotFound: [404] {"error":"IndexMissingException[[posts] missing]","status":404}
I ran bundle exec rake environment elasticsearch:import:model CLASS='Post'
it but still get the same error.
According to Marvin Gaia, what's going on?
+3
source to share