Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow client Faraday adapter to be configured via the 'elastic.yml' file #5

Open
iobaixas opened this issue Jun 6, 2017 · 5 comments

Comments

@iobaixas
Copy link
Member

iobaixas commented Jun 6, 2017

Currently only the host and port are configurable. We should add support for more options, like the Faraday adapter (all available options can be seen here: https://github.com/elastic/elasticsearch-ruby/blob/master/elasticsearch-transport/lib/elasticsearch/transport/client.rb).

I propose adding the adapter option to the Configuration class.

@iobaixas iobaixas changed the title Allow client transport to be configured Allow client adapter to be configured Aug 3, 2017
@iobaixas iobaixas changed the title Allow client adapter to be configured Allow client Faraday adapter to be configured via the elastic.yml file Aug 3, 2017
@iobaixas iobaixas changed the title Allow client Faraday adapter to be configured via the elastic.yml file Allow client Faraday adapter to be configured via the 'elastic.yml' file Aug 3, 2017
@afromankenobi
Copy link

Hi! i'm working on this and some test are failing, any idea why?
i'm using ruby 2.2, following your travis spec

Failures:

  1) Elastic::Core::Connector when index already exists and mapping cant be synchronized migrate regenerates index with new map and moves records to new index
     Failure/Error: api.delete_by_query(index: _index, body: { query: { term: { _mark_for_deletion: true } } })

     Elasticsearch::Transport::Transport::Errors::BadRequest:
       [400] No handler found for uri [/elastic_gem_specs_idx_name%3A1508954385/_query] and method [DELETE]
     # /Users/jorgevargas/.rvm/gems/ruby-2.2.6/gems/elasticsearch-transport-1.1.3/lib/elasticsearch/transport/transport/base.rb:201:in `__raise_transport_error'
     # /Users/jorgevargas/.rvm/gems/ruby-2.2.6/gems/elasticsearch-transport-1.1.3/lib/elasticsearch/transport/transport/base.rb:312:in `perform_request'
     # /Users/jorgevargas/.rvm/gems/ruby-2.2.6/gems/elasticsearch-transport-1.1.3/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
     # /Users/jorgevargas/.rvm/gems/ruby-2.2.6/gems/elasticsearch-transport-1.1.3/lib/elasticsearch/transport/client.rb:128:in `perform_request'
     # /Users/jorgevargas/.rvm/gems/ruby-2.2.6/gems/elasticsearch-api-1.1.3/lib/elasticsearch/api/actions/delete_by_query.rb:71:in `delete_by_query'
     # ./lib/elastic/core/connector.rb:216:in `delete_marked_for_deletion'
     # ./lib/elastic/core/connector.rb:128:in `rollover'
     # ./lib/elastic/core/connector.rb:45:in `migrate'
     # ./spec/lib/core/connector_spec.rb:148:in `block (5 levels) in <top (required)>'
     # ./spec/lib/core/connector_spec.rb:148:in `block (4 levels) in <top (required)>'
     # ./spec/support/elasticsearch.rb:22:in `block (2 levels) in <top (required)>'

@blackjid
Copy link
Member

Hi!, thanks for looking into this...

Are running the tests against elasticsearch 2.4 or higher?? that might be the problem, try with elasticsarch 1.7.

Also be sure to run the tests with bundle exec rspec spec to be confident you are using the correct version of the elasticsearch gem. That gem is a dependency and the version of the gem has direct relation with the elasticsearch version supported.

@afromankenobi
Copy link

Thanks @blackjid, installing elasticsearch 1.4 solves the problem.

@blackjid
Copy link
Member

👍 great!, that's the next step, to upgrade our elasticsearch support to the newer versions...

@afromankenobi
Copy link

I'll collaborate :)

afromankenobi pushed a commit to afromankenobi/elastic-rails that referenced this issue Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants