No handler found for uri [/<index>/<type>/] and method [POST]

情到浓时终转凉″ 提交于 2019-12-23 02:58:36

问题


Hi i am working on a RoR project with ruby-2.4.0 and rails 5. I am using elasticsearch for searching in my app. I have a model venue_details as follows:-

class VenueDetail < ActiveRecord::Base
    include Tire::Model::Search
  include Tire::Model::Callbacks

  settings index: { 
    number_of_shards: 1, 
    number_of_replicas: 0,
  } do
    mapping do
      indexes :id, :index => :not_analyzed
      indexes :venue_name, :type => 'string', :index => :analyzed
    end
  end

  def self.search(params)
    if params[:query].present?
      tire.search(load: true) do
        query { string "*#{params[:query]}*", default_operator: "AND" }
         size 100
      end      
    else
      tire.search(load: true) do
        query { string "*#{params[:term]}*", default_operator: "AND"}
         size 100
      end
    end 
  end
end

I am using the elasticsearch-5.1.2. I am trying to reindex the venue details with command rake environment tire:import CLASS=VenueDetail FORCE=true it throws an error as follows:-

There has been an error when creating the index -- elasticsearch returned:
400 : No handler found for uri [/venue_details] and method [POST]

Please help how can i fix it. Thanks in advance.

来源:https://stackoverflow.com/questions/50291905/no-handler-found-for-uri-index-type-and-method-post

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!