简体   繁体   English

Searchkick:Elasticsearch 没有索引“FORBIDDEN/12/index read-only”?

[英]Searchkick: Elasticsearch not indexing "FORBIDDEN/12/index read-only"?

I've setup a new development environment on my iMac and moved my rails app from a macbook air.我在我的 iMac 上设置了一个新的开发环境,并从 macbook air 移动了我的 Rails 应用程序。 It was working fine and indexing the data as well.它工作正常并且也为数据建立了索引。 Using the same version of gems.使用相同版本的宝石。 When indexing it gives following error.索引时会出现以下错误。

Searchkick::ImportError: {"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"} on item with id '74'

Is there any way I can solve this issue by modifying my elasticsearch.yml?有什么办法可以通过修改我的 elasticsearch.yml 来解决这个问题吗?

来自https://github.com/ankane/searchkick/issues/1040 上的salihsagdilekon 的这个解决方案为我解决了同样的问题:

curl -XPUT -H "Content-Type: application/json" > http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

我今天遇到了同样的问题,以下对我有用:

Model.search_index.clean_indices

You can execute the following in rails console:您可以在 Rails 控制台中执行以下命令:

MyModel.reindex

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

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