2017-08-15 130 views
2

嘗試在Elasticsearch和Tire上部署heroku生產中的rails應用程序。 Heroku的盆景插件添加,但仍運行此命令未找到處理uri [/ ModelName]的處理程序和方法[POST]

heroku run rake environment tire:import CLASS=Property FORCE=true

收到錯誤後:

400 : No handler found for uri [/properties] and method [POST]

請幫助調試這個錯誤?

這是我的財產型號:

class Property < ApplicationRecord 
include Tire::Model::Search 
include Tire::Model::Callbacks 

    mapping do 
    indexes :id, type: 'integer' 
    indexes :country 
    indexes :city 
    indexes :province 
    indexes :holding_type 
    indexes :price, boost: 10 
    indexes :created_at, type: 'date' 
end 
end 

這是我的盆景配置配置/初始化/ bonsai.rb

ENV['ELASTICSEARCH_URL'] = ENV['BONSAI_URL'] 

回答

0

這已經是一個Elasticsearch錯誤信息,所以你達到了它 - 只有你的查詢不正確。

我在這裏採取瘋狂猜測:你錯過了type;至少這是(一)可能性如何遇到這個錯誤。

$ curl -XPOST localhost:9200/properties/ -d '{"foo": "bar"}' 
No handler found for uri [/properties/] and method [POST] 

PS:現在輪胎還沒有維護/不推薦使用嗎?我認爲最好的選擇應該是https://github.com/elastic/elasticsearch-rails

+0

$ curl -XPUT localhost:9200/properties- works! – webber

+0

是的,這會創建索引 – xeraa

相關問題