如何构建任务'elasticsearch:import:model' [英] How to build task 'elasticsearch:import:model'
本文介绍了如何构建任务'elasticsearch:import:model'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗯,我已经安装了elasticsearch-rails gem(版本0.1.5),我可以清楚地看到宝石文件中的任务。
但是当我运行
bundle exec rake environment elasticsearch:import:model CLASS ='Comment'
pre>
我收到此错误。
运行
rake环境-D
不显示任务。
elasticsearch正在运行,如果我卷曲
http:// localhost:9200
它回应我。
为什么这不工作?
解决方案你需要创建elasticsearch.rake
cat lib / tasks / elasticsearch.rake
require'弹性搜索/ rails / tasks / import'
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?
解决方案you need create elasticsearch.rake
cat lib/tasks/elasticsearch.rake require 'elasticsearch/rails/tasks/import'
这篇关于如何构建任务'elasticsearch:import:model'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文