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 ?
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.
Most helpful comment
Can you try removing the slash from the URL --
http://172.17.0.2:9200/?