尝试使用带有heroku
的生产应用上的Searchkick重新索引时出现此错误heroku run rake searchkick:reindex CLASS=Chapter
以下命令用于重新索引
class Chapter < ActiveRecord::Base
searchkick word_start: [:title, :body], highlight: [:body]
end
章节模型
server:hrsimpleV3.0 justinMgrant$ heroku run rake searchkick:reindex CLASS=Chapter
Running rake searchkick:reindex CLASS=Chapter on boiling-harbor-8117... up, run.1302
Starting up a new ElasticSearch client with
Scoped order and limit are ignored, it's forced to be batch order and batch size
Chapter Load (12.5ms) SELECT "chapters".* FROM "chapters" ORDER BY "chapters"."id" ASC LIMIT 1000
Chapter Import (345.2ms) {"count":8,"exception":["Searchkick::ImportError","Searchkick::ImportError"]}
rake aborted!
Searchkick::ImportError: Searchkick::ImportError
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/index.rb:76:in `block in import'
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/index.rb:68:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/index.rb:68:in `import'
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/logging.rb:47:in `block in import_with_instrumentation'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:164:in `block in instrument'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:164:in `instrument'
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/logging.rb:46:in `import_with_instrumentation'
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/index.rb:193:in `block in import_scope'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.1/lib/active_record/relation/batches.rb:124:in `find_in_batches'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.1/lib/active_record/querying.rb:9:in `find_in_batches'
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/index.rb:192:in `import_scope'
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/index.rb:168:in `reindex_scope'
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/model.rb:51:in `searchkick_reindex'
/app/vendor/bundle/ruby/2.0.0/gems/searchkick-1.0.2/lib/searchkick/tasks.rb:9:in `block (2 levels) in <top (required)>'
Tasks: TOP => searchkick:reindex
这是错误
dsT