弹性搜索 - 如何导入数据?

时间:2014-02-18 05:44:59

标签: ruby ruby-on-rails-3 elasticsearch rake tire

当我跑步时

rake environment tire:import CLASS='Article.all' INDEX='mongo-articles' FORCE=true

在弹性搜索中导入数据

** Invoke environment (first_time)
** Execute environment
** Invoke tire:import (first_time)
** Execute tire:import
[IMPORT] Deleting index 'mongo-articles'
rake aborted!
undefined method `tire' for #<Tire::Results::Collection:0xabec954>
/home/helios/.rvm/gems/ruby-1.9.3-p484@munksearch/gems/tire-0.5.1/lib /tire/tasks.rb:55:in `block (2 levels) in <top (required)>'
Tasks: TOP => tire:import

有谁知道如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

.all删除Article.all

rake environment tire:import CLASS='Article' INDEX='mongo-articles' FORCE=true

此外,我建议删除INDEX参数,看看是否有帮助。