【问题标题】:Rails: running my seeds file and elasticsearch throws: more than one indicesRails:运行我的种子文件和 elasticsearch 抛出:多个索引
【发布时间】:2017-06-09 19:03:15
【问题描述】:

所以我正在运行一个大型且相当复杂的种子文件。在批量保存它们之前,我批量创建所有类型的关联记录。我遇到了一个问题,我收到了这个错误:

Elasticsearch::Transport::Transport::Errors::BadRequest: [400] 
{"error":{"root_cause":
[{"type":"illegal_argument_exception","reason":"Alias 
[clients_development] has more than one indices associated with it 
[[clients_development_20170106095823597, 
clients_development_20161123102035835]], can't execute a single index 
op"}],"type":"illegal_argument_exception","reason":"Alias 
[clients_development] has more than one indices associated with it 
[[clients_development_20170106095823597, 
clients_development_20161123102035835]], can't execute a single index 
op"},"status":400}
/Users/

看起来我有一个数据库问题?测试/开发数据库,​​也许?我已经运行了很多 rake 命令,但他们认为这个坏男孩:

rake db:drop && rake db:create && rake db:migrate && rake db:schema:dump && rake db:test:prepare

在此过程中我遇到了同样的错误。有人知道发生了什么吗?

【问题讨论】:

    标签: ruby-on-rails elasticsearch rake seeding elasticsearch-indices


    【解决方案1】:

    您可以尝试确保 Elasticsearch 不会在多个地方运行。之后,尝试重新索引所有记录:

    rake searchkick:reindex:all
    

    【讨论】:

    • 谢谢!就是这样。
    猜你喜欢
    • 2020-12-27
    • 1970-01-01
    • 2012-07-09
    • 1970-01-01
    • 1970-01-01
    • 2019-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多