Elasticsearch-rails: Elasticsearch::Transport::Transport::Errors::BadRequest: [400] No handler found for uri [//histories] and method [DELETE]

Created on 2 Feb 2017  路  3Comments  路  Source: elastic/elasticsearch-rails

Hello,

This is the error when I try to do a get request on my history model localhost:3000/history (CRUD). Here is my model :

require 'elasticsearch/model'

class History < ApplicationRecord
  include Elasticsearch::Model
  include Elasticsearch::Model::Callbacks
end

History.__elasticsearch__.client = Elasticsearch::Client.new host: 'http://172.17.0.2:9200/'
History.import force: true

I'm using Elasticsearch in a docker image.
My index method in my controller is the following :

def index
    histories = History.all
    render json: histories
end

Ruby : RVM - 2.4.0
Rails : 5.0.1

It's very basic. Do you guys have any solutions ?

Most helpful comment

Can you try removing the slash from the URL -- http://172.17.0.2:9200/?

All 3 comments

Can you try removing the slash from the URL -- http://172.17.0.2:9200/?

This works without the '/' at the end of the host. Thank you.

Glad it's working. I'll think about some way of "squeezing" the double slashes in the library.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skukx picture skukx  路  4Comments

akhilaraop picture akhilaraop  路  5Comments

AaronRustad picture AaronRustad  路  6Comments

mcoms picture mcoms  路  4Comments

suras picture suras  路  6Comments