简体   繁体   English

如何修复 Elasticsearch “无效索引和/或索引错误”

[英]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:我必须格式化我的电脑,当再次使用 Elasticsearch 设置我的本地环境时,我收到了这个错误:

{"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]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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