rake environment elastic search:import:all FORCE=y keeps failing

半世苍凉 提交于 2019-12-06 08:32:16

We were having the same issue this morning.

The elastic-search-model documentation tells you to set up your models like this:

class User < ActiveRecord::Base
  include Elasticsearch::Model
  include Elasticsearch::Model::Callbacks

  #The rest of your mode...
end

User.import

But before importing your existing data, you need to remove User.import then run rake environment elasticsearch:import:all FORCE=y and everything will go smoothly.

Remember to add User.import after running the rake task so your new users will be imported properly.

Happy Coding!

try YourModelName.import(force: true) in rails console.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!