简体   繁体   中英

How to fix Elasticsearch “Invalid index and/or indexing error”

I had to format my computer, when setting up my local environment again with Elasticsearch, I got this error:

{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"model","index_uuid":"_na_","index":"model"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"model","index_uuid":"_na_","index":"model"},"status":404}

app/service_wrappers/elastic_search_client.rb:20:in `search'
app/queries/filter_query.rb:19:in `filter'
app/services/filter_services/apply_filters.rb:52:in `filter'
app/controllers/filters_controller.rb:70:in `apply_search'
app/controllers/application_controller.rb:508:in `block in render_json_on_logged_in_exception'
lib/concerns/traceable.rb:14:in `trace'
lib/concerns/traceable.rb:40:in `trace_callback'
app/controllers/application_controller.rb:506:in `render_json_on_logged_in_exception'
app/controllers/application_controller.rb:209:in `block in catch_db_exceptions'
lib/concerns/traceable.rb:14:in `trace'
lib/concerns/traceable.rb:40:in `trace_callback'
app/controllers/application_controller.rb:205:in `catch_db_exceptions'

The solution was to run the following

bundle exec rake elasticsearch:reload

In some cases you may need to run it this way

bundle exec rake elasticsearch:reload[instance]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM