问题
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