Skip to content
New issue

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

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

Already on GitHub? # to your account

Importing to amazon elastic search service #271

Closed
drnluz opened this issue Oct 19, 2015 · 5 comments
Closed

Importing to amazon elastic search service #271

drnluz opened this issue Oct 19, 2015 · 5 comments

Comments

@drnluz
Copy link

drnluz commented Oct 19, 2015

Hello. I'm trying to import a model to the amazon elasticsearch service but I'm getting the following error:

Elasticsearch::Transport::Transport::Errors::Forbidden: [403] {"message":"When Content-Type:application/x-www-form-urlencoded, URL cannot include query-string parameters (after '?'): '/all/factory/_bulk?refresh=false'"}

Digging a little I found that amazon ES service does not accept query parameters.
Is there a way to run MyIndex.reset! without sending refresh as a query parameter?

@pyromaniac
Copy link
Contributor

Well, it is quite hardcoded here:

bulk_options = import_options.reject { |k, v| ![:refresh, :suffix].include?(k) }.reverse_merge!(refresh: true)

But you may send a patch of de-hardcoding :) Like, in case of refresh: false don't add anything.

@pyromaniac
Copy link
Contributor

I didn't expect such a behavior, Amazon engineers are strange guys, ES itself doesn't have such a strict rules

@yurifrl
Copy link

yurifrl commented Nov 12, 2015

Hy @drnluz , any updates on this issue?
Same problem here

@feymartynov
Copy link
Contributor

Had the same issue with AWS. Fixed with explicitly specifying Content-Type header in chewy.yml:

production:
  host: 'some-host.es.amazonaws.com:80'
  transport_options:
    headers:
      content_type: 'application/json'

@pyromaniac
Copy link
Contributor

Perfect, thanks for the solution!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants