How to build task 'elasticsearch:import:model'

蹲街弑〆低调 提交于 2019-12-04 09:34:11

问题


Well, I have elasticsearch-rails gem installed (version 0.1.5) and I can clearly see the task inside the gem files.

But when I run

bundle exec rake environment elasticsearch:import:model CLASS='Comment'

I get this error.

Running rake environment -D doesn't show me the task either.

elasticsearch is running, if I curl http://localhost:9200 it responds me.

Why isn't this working?


回答1:


you need create elasticsearch.rake

cat lib/tasks/elasticsearch.rake
require 'elasticsearch/rails/tasks/import'


来源:https://stackoverflow.com/questions/25877590/how-to-build-task-elasticsearchimportmodel

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