我的模型:
class Package < ActiveRecord::Base
include Elasticsearch::Model
include Elasticsearch::Model::Callbacks
end
当我询问索引是否存在时,我得到true
:
Package.__elasticsearch__.client.indices.exists(index: "packages")
=> true
但是当我这样做时:
Package.__elasticsearch__.client.indices.get(index: "packages")
我收到此错误:
Elasticsearch::Transport::Transport::Errors::BadRequest: [400] No handler found for uri [/packages] and method [GET]
我已经索引了一些文档,并且可以进行搜索,那么上面的行有什么问题?
ps:这是文档:http ://www.rubydoc.info/gems/elasticsearch-api/Elasticsearch/API/Indices/Actions