Elasticsearch::Transport::Transport::Errors::NotFound ([404] {"error":{"root_cause":[{"type":"index_not_found_exception"
Fixed issue by indexing ES by running these commands at rails console
: -
Model.__elasticsearch__.create_index!Model.__elasticsearch__.create_index! force: trueModel.import force: true
You can also follow this steps i find on rubydoc website :
require the task definition in your application, eg. in the lib/tasks/elasticsearch.rake file:
require 'elasticsearch/rails/tasks/import'
To import the records from your model, run:
bundle exec rake environment elasticsearch:import:model CLASS='ModelName'
Or you can use:
rake environment elasticsearch:import:all DIR=app/models
to import all models.