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

ES 6.x support #756

Closed
peter-hank opened this issue Nov 16, 2017 · 34 comments
Closed

ES 6.x support #756

peter-hank opened this issue Nov 16, 2017 · 34 comments

Comments

@peter-hank
Copy link

peter-hank commented Nov 16, 2017

Does the gem support Elasticsearch 6.x? If not, do you plan to support it anytime soon?

@peter-hank peter-hank changed the title ES6 support ES 6.x support Nov 16, 2017
@karmi
Copy link
Contributor

karmi commented Nov 16, 2017

Hi @peter-hank, the libraries should in general support Elasticsearch 6.x, but it might require some additional configuration, namely when it comes to removal of types. Eg. the elasticsearch-model in the default configuration will try to use multiple types per model class, so a user configuration which makes it use a separate index for each model class might be needed.

Also, the tests and examples haven't been yet updated to 6.x, which is something needed... We do plan to support 6.x as soon as possible in the default configuration of the gems, but I don't have a concrete date.

@sly7-7
Copy link

sly7-7 commented Dec 6, 2017

@karmi In order to test this, I guess I must use the master branch ? (Also, maybe you want some help to update the tests and examples ?)

@Aesthetikx
Copy link

Just anecdotal evidence, I have been seeing HTTP 406 errors on 6.x, haven't dug into why though.

Failure/Error: model.__elasticsearch__.create_index!(force: true)
     
     Elasticsearch::Transport::Transport::Errors::NotAcceptable:
       [406] {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

@tenaz3
Copy link

tenaz3 commented Jan 13, 2018

How can I have the elasticsearch 6 with elasticsearch-rails 5 ?

  In Gemfile:
    elasticsearch (~> 6.0)

    elasticsearch-model (>= 5.0.2, ~> 5.0) was resolved to 5.0.2, which depends on
      elasticsearch (~> 5)

    elasticsearch-model (>= 5.0.2, ~> 5.0) was resolved to 5.0.2, which depends on
      elasticsearch (~> 5)

@karmi
Copy link
Contributor

karmi commented Jan 14, 2018

@tenaz3, so what is exactly the problem with 6 and 5? The elasticsearch-model has a very relaxed dependency on the Elasticsearch client. I've just generated a new Rails 5, and when added the following to the Gemfile:

gem 'elasticsearch', '~> 6'
gem 'elasticsearch-model', '~> 5'

this is what I see after running bundle install:

$ grep 'elasticsearch' Gemfile.lock 
  elasticsearch (6.0.0)
    elasticsearch-api (= 6.0.0)
    elasticsearch-transport (= 6.0.0)
  elasticsearch-api (6.0.0)
  elasticsearch-model (5.0.0)
    elasticsearch (> 1)
  elasticsearch-transport (6.0.0)
 elasticsearch (~> 6)
 elasticsearch-model (~> 5)

which seems to satisfy the requirement?

@karmi
Copy link
Contributor

karmi commented Jan 14, 2018

@Aesthetikx, this would indicate that you're using an older elasticsearch gem, can you check that you have upgraded the dependency for elasticsearch to something like ~> 6?

@lulessa
Copy link

lulessa commented Jan 19, 2018

@karmi Your suggestion works. However, since v5.0.1, elasticsearch-model has depended on 'elasticsearch', '~> 5'.

s.add_dependency "elasticsearch", '~> 5'

Following your suggestion to add this to Gemfile

gem 'elasticsearch', '~> 6'
gem 'elasticsearch-model', '~> 5'

Note that it will install elasticsearch-model 5.0.0. I suppose this is good enough (we don't get the patch versions) because we are really looking forward to version 6.

@surjay
Copy link

surjay commented Feb 5, 2018

Are there any updates on the timeline for this? It looks like master is pointing towards 6.0alpha now? ES is officially at 6.1.3 as of January.

@kaspergrubbe
Copy link

It would be wonderful to have an ETA, are we looking at Q2 or Q3?

@karmi
Copy link
Contributor

karmi commented Feb 15, 2018

Right! We are looking at investing some significant effort into the elasticsearch-rails family of gems in couple of months, so realistically, Q3 would be the answer here. (Again, please note that the dependencies are very relaxed and the -rails gems should be freely mixable with -ruby gems, and the main practical issue I see is the configuration for index_name and dcoument_type, so the gem doesn't try to mash multiple models into one index.)

@jalberto
Copy link
Contributor

it doesn't works for elasticsearch-persistence

Bundler could not find compatible versions for gem "elasticsearch":
  In Gemfile:
    elasticsearch (~> 6.0)

    elasticsearch-persistence (~> 5.0) was resolved to 5.0.2, which depends on
      elasticsearch (~> 5)

@karmi
Copy link
Contributor

karmi commented Feb 27, 2018

@jalberto, that's really strange, can you post your Gemfile (and possibly a Ruby version), so I can run it?

@jalberto
Copy link
Contributor

@karmi

ruby 2.4.1

My Gemfile is quite long but this is the relevant part:

group :default, :elk do
  gem 'elasticsearch' , "~> 6.0"
  gem "elasticsearch-persistence" , "~> 5.0"
end

This is lockfile relevant part with versions set to 5.x:

    elasticsearch (5.0.4)
      elasticsearch-api (= 5.0.4)
      elasticsearch-transport (= 5.0.4)
    elasticsearch-api (5.0.4)
      multi_json
    elasticsearch-model (5.0.2)
      activesupport (> 3)
      elasticsearch (~> 5)
      hashie
    elasticsearch-persistence (5.0.2)
      activemodel (> 4)
      activesupport (> 4)
      elasticsearch (~> 5)
      elasticsearch-model (~> 5)
      hashie
      virtus
    elasticsearch-transport (5.0.4)
      faraday
      multi_json

@leifcr
Copy link

leifcr commented Apr 9, 2018

This requirement elasticsearch (~> 5) corresponds to elasticsearch (~> 5.0) which will be the same as elasticsearch (> 6.0, <=5.0)

In order to support both 5.x and 6.x, this requirement must be changed to >= 5.0

@karmi
Copy link
Contributor

karmi commented Apr 25, 2018

Sorry for the silence here. @leifcr's suggestion sounds right, would that work for you. As I wrote in the other tickets, I still need to focus on other responsibilities at the moment, but we're planning a significant attention to the elasticsearch-rails group of libraries soon.

@jalberto
Copy link
Contributor

@karmi I still need to test that solution, but if it works is good to go.

@karmi
Copy link
Contributor

karmi commented Apr 25, 2018

@jalberto , let me know please. I'll find a time to try a Gemfile on my side if it doesn't work.

@pctj101
Copy link

pctj101 commented May 17, 2018

As a note for the curious, for example this kind of parent-child type does not work:
elasticsearch-model/test/integration/active_record_associations_parent_child_test.rb

Where it says something like:

  mapping _parent: { type: 'question' }, _routing: { required: true } do

This is the kind of document/test which would need to be updated and operate fairly differently than previous ES versions.

In my case, I may need to do a gradual migration between ES vOld and ES v6, so it would be nice for class names to be entirely different so a ESv2 gem could be run simultaneously with a ESv6 gem during transition. But not sure if that makes sense for the maintainers.

@leifcr
Copy link

leifcr commented Jun 18, 2018

PR #797 is missing fixing the parent relationship tests to use join mapping instead of _parent.

@estolfo
Copy link
Contributor

estolfo commented Jun 29, 2018

Hi all
We are working towards a 6.x release of the gem in a few weeks. Currently, the work and testing against ES 6.x is in the 6.x branch.

Is there any reason you think we should keep this issue open seeing as we have active development now in the 6.x branch?

@estolfo estolfo added the waiting-for-user Waiting for user input to proceed label Jun 29, 2018
@kaspergrubbe
Copy link

@estolfo Please keep this issue open until support for 6.0 is shipped. It will be a nice indicator how things are progressing for everyone interested.

@estolfo
Copy link
Contributor

estolfo commented Jul 2, 2018

ok, no problem

@kaspergrubbe
Copy link

@estolfo How come the label for this issue is waiting-for-user, what do you need from us to continue?

@estolfo
Copy link
Contributor

estolfo commented Jul 4, 2018

Sorry @kaspergrubbe, I put that label when I originally asked if I could close the issue. I'll take that label off now.

@estolfo estolfo removed the waiting-for-user Waiting for user input to proceed label Jul 4, 2018
@estolfo
Copy link
Contributor

estolfo commented Aug 15, 2018

Hello, I wanted to let you all know that there are a 6.0.0.pre versions available of the elasticsearch-rails, elasticsearch-model, and elasticsearch-persistence gems, if you'd like to try them out in your testing environments.
Please open a GitHub issue if you'd like to report anything. Thanks!

@estolfo
Copy link
Contributor

estolfo commented Sep 4, 2018

I'm pinging this thread again to remind everyone that a 6.0.0.pre version is available for the rails integration gems. Please open an issue if you find any.

@estolfo
Copy link
Contributor

estolfo commented Sep 6, 2018

6.0.0 of the rails integration gems is released.

@jalberto
Copy link
Contributor

@estolfo looks like Elasticsearch::Persistence.client= is not present in version 6. Is there any Changelog with breaking changes? (Changelog file seems quite old)

@estolfo
Copy link
Contributor

estolfo commented Sep 13, 2018

Hi @jalberto
You will have to set a client on the Repository class or instance instead.
You may find this documentation useful.
Please see the CHANGELOG on the 6.x branch.
And this blog post has in-depth explanations of how to use the Repository pattern. Let me know if you have any specific questions!

@jalberto
Copy link
Contributor

thanks @estolfo still I cannot see a "breaking changes" list, will be very useful for a migration from 5.x to 6.x.

Also will be great to know why those breaking changes happened, in particular if not deprecation warnings has been implemented. I am sure there are good reasons behind that decisions, still a good practice.

@estolfo
Copy link
Contributor

estolfo commented Sep 14, 2018

Hi @jalberto, I've created entries for the two releases (6.0.0.pre and 6.0.0) and put the list of changes there. I've also included a list of breaking changes in the details for 6.0.0. Please let me know if there's anything else I can do to make the change log clearer for these versions.
I'll continue using the Releases list in the future so that it's easier to parse what changes go into each version and so that I can communicate breaking changes more effectively. Thanks for your suggestions!

@jalberto
Copy link
Contributor

thanks @estolfo that is what I needed.Great work.
Right now the Changelog and release notes contains different information so it's bit confusing.

@estolfo
Copy link
Contributor

estolfo commented Sep 18, 2018

@jalberto
The CHANGELOG is automatically generated as part of a rake task when we release the gems. I'm going to leave it as-is for now. I'm considering removing it and converting all the release notes to the GitHub releases so that there's only one source of the change log.

@estolfo
Copy link
Contributor

estolfo commented Sep 18, 2018

I'm going to close this issue, as the gems supporting Elasticsearch 6.0 have been released for over a week.

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

No branches or pull requests