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

Upgrade to Elasticsearch 5.0 #1184

Closed
7 of 10 tasks
ruflin opened this issue Oct 11, 2016 · 21 comments
Closed
7 of 10 tasks

Upgrade to Elasticsearch 5.0 #1184

ruflin opened this issue Oct 11, 2016 · 21 comments

Comments

@ruflin
Copy link
Owner

ruflin commented Oct 11, 2016

Elasticsearch 5.0 brings several breaking changes which affect Elastica. This issue is to track the open tasks to make Elastica fully compatible with elasticsearch 5.0.

  • Remove all depercated methods as this is a major release
  • Remove filters as filters are replaced by query
  • Testing
    • Fix tests which are currently skipped because of incompatibility
    • Fix Set fielddata=true on [answer] in order to load fielddata in memory tests
  • Implement percolate query and remove Percolator: https://www.elastic.co/guide/en/elasticsearch/reference/5.0/query-dsl-percolate-query.html
  • Remove image plugin support
  • Double check which PHP versions should be supported
  • Remove filtered query in favor of Bool queries
  • Add Painless as script language
ruflin added a commit that referenced this issue Oct 11, 2016
* Replace remove count search type by query_then_fetch
* Replace optimize by forcemerge as optimize was removed
* Rename getMock() to createMock() to be compatible with newer phpunit versions
* Convert string mapping to text
* Change delete-by-query implementation to use 5.0 api
* Remove delete-by-query plugin checks as now installed by default
* Change script implementation to new 5.0 implementation
* Simplify update-document
* Update test environment to use self built elasticsearch instance
* Improve node info fetching to use new format
* Skip plugin tests if no plugin available
* Fix list of tests
* Apply liniting
* Fix script tests for new script structure
* Remove search_type from scroll as not needed anymore

Part of #1184
ruflin added a commit that referenced this issue Oct 11, 2016
* Replace remove count search type by query_then_fetch
* Replace optimize by forcemerge as optimize was removed
* Rename getMock() to createMock() to be compatible with newer phpunit versions
* Convert string mapping to text
* Change delete-by-query implementation to use 5.0 api
* Remove delete-by-query plugin checks as now installed by default
* Change script implementation to new 5.0 implementation
* Simplify update-document
* Update test environment to use self built elasticsearch instance
* Improve node info fetching to use new format
* Skip plugin tests if no plugin available
* Fix list of tests
* Apply liniting
* Fix script tests for new script structure
* Remove search_type from scroll as not needed anymore

Part of #1184
ruflin added a commit that referenced this issue Oct 11, 2016
* Replace remove count search type by query_then_fetch
* Replace optimize by forcemerge as optimize was removed
* Rename getMock() to createMock() to be compatible with newer phpunit versions
* Convert string mapping to text
* Change delete-by-query implementation to use 5.0 api
* Remove delete-by-query plugin checks as now installed by default
* Change script implementation to new 5.0 implementation
* Simplify update-document
* Update test environment to use self built elasticsearch instance
* Improve node info fetching to use new format
* Skip plugin tests if no plugin available
* Fix list of tests
* Apply liniting
* Fix script tests for new script structure
* Remove search_type from scroll as not needed anymore
* Update README.md with new dependency

Part of #1184
ruflin added a commit that referenced this issue Oct 11, 2016
In this first step, all tests are checked which are not compatible with elasticsearch 5.0. Either the tests are directly fixed or they are temporarely skipped and have to be cleaned up later. In general it seems as most of the things will just keep working with elasticsearch 5.0 except for the things that were changed / removed in elasticsearch 5.0 anyways (like mapping changes from string to text / keyword).

* Replace remove count search type by query_then_fetch
* Replace optimize by forcemerge as optimize was removed
* Rename getMock() to createMock() to be compatible with newer phpunit versions
* Convert string mapping to text
* Change delete-by-query implementation to use 5.0 api
* Remove delete-by-query plugin checks as now installed by default
* Change script implementation to new 5.0 implementation
* Simplify update-document
* Update test environment to use self built elasticsearch instance
* Improve node info fetching to use new format
* Skip plugin tests if no plugin available
* Fix list of tests
* Apply liniting
* Fix script tests for new script structure
* Remove search_type from scroll as not needed anymore
* Update README.md with new dependency

Part of #1184
ruflin added a commit that referenced this issue Oct 11, 2016
In this first step, all tests are checked which are not compatible with elasticsearch 5.0. Either the tests are directly fixed or they are temporarely skipped and have to be cleaned up later. In general it seems as most of the things will just keep working with elasticsearch 5.0 except for the things that were changed / removed in elasticsearch 5.0 anyways (like mapping changes from string to text / keyword).

* Replace remove count search type by query_then_fetch
* Replace optimize by forcemerge as optimize was removed
* Rename getMock() to createMock() to be compatible with newer phpunit versions
* Convert string mapping to text
* Change delete-by-query implementation to use 5.0 api
* Remove delete-by-query plugin checks as now installed by default
* Change script implementation to new 5.0 implementation
* Simplify update-document
* Update test environment to use self built elasticsearch instance
* Improve node info fetching to use new format
* Skip plugin tests if no plugin available
* Fix list of tests
* Apply liniting
* Fix script tests for new script structure
* Remove search_type from scroll as not needed anymore
* Update README.md with new dependency

Part of #1184
ruflin added a commit that referenced this issue Oct 12, 2016
* Remove outdated QueryBuilder. Update 2.4 query builder to only use queries
* Remove deprecated Script*.php classes

Part of #1184
ruflin added a commit that referenced this issue Oct 12, 2016
* Remove outdated QueryBuilder. Update 2.4 query builder to only use queries
* Remove deprecated Script*.php classes

Part of #1184
ruflin added a commit that referenced this issue Oct 13, 2016
* Remove outdated QueryBuilder. Update 2.4 query builder to only use queries
* Remove deprecated Script*.php classes

Part of #1184
@Zyqsempai
Copy link
Contributor

Hi there, i will be glad to help you with this migration, please give me some short description, for example for "Remove image plugin support", do you want to completely delete it from project? Or give some other task!

@ruflin
Copy link
Owner Author

ruflin commented Oct 18, 2016

@Zyqsempai Great to hear. What I already did is removing all the filters and skip all the tests which do not pass at the moment. I added a message to each of this tests on why they don't pass (see https://travis-ci.org/ruflin/Elastica/jobs/167274669#L2135). We need to go through each of this test an figure out how it should be fixed. Most of them should be an easy fix.

To start simple: I think the image plugin is not under active development any more. So we should remove this one completely from the code and tests.

@Zyqsempai
Copy link
Contributor

ok then i will start with image plugin a then move on to tests

Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Oct 19, 2016
 - Remove Elastica/Query/Image.php
 - Remove test/Elastica/Query/ImageTest.php
 - Changelog update
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Oct 19, 2016
 This commit is for Travis rebuild.
@Zyqsempai
Copy link
Contributor

So, what about this type of skipped tests, "script.inline is not enabled. This is required for this test", i checked your elasticsearch.yml and i found this "script.inline: on" i also tried to add something like this "script.engine.groovy.inline.aggs: on" and no results, do you know source of this problem?

@Zyqsempai
Copy link
Contributor

Also, this one "Skipped because of 5.0: unknown setting [index.merge.policy.merge_factor] did you mean [index.merge.policy.max_merge_at_once]" this is strange because according to this https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_setting_changes.html#_merge_and_merge_throttling_settings , this error mast appear after 2.4 version migration, anyway it seams like we can't fix it for Version > 2.4

Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Oct 19, 2016
- Remove Elastica/Query/Filtered.php
- Remove test/Elastica/Query/FilteredTest.php
- Remove all references for filtered query from code
- Changelog update
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Oct 21, 2016
…ce [geo_distance_range] queries with geo distance sorting.
@ruflin
Copy link
Owner Author

ruflin commented Oct 24, 2016

@Zyqsempai Sorry for the delay in answering, was on vacation last week. About the issues above: Didn't check them in detail yet. For some option it can be that they don't exist anymore and we have to remove them or rename them.

ruflin pushed a commit that referenced this issue Oct 24, 2016
 - Remove Elastica/Query/Image.php
 - Remove test/Elastica/Query/ImageTest.php
 - Changelog update
ruflin pushed a commit that referenced this issue Oct 24, 2016
…o_distance_range] queries with geo distance sorting. (#1191)
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Oct 24, 2016
- Remove Elastica/Query/Filtered.php
- Remove test/Elastica/Query/FilteredTest.php
- Remove all references for filtered query from code
- Changelog update
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Oct 24, 2016
- Remove Elastica/Query/Filtered.php
- Remove test/Elastica/Query/FilteredTest.php
- Remove all references for filtered query from code
- Changelog update
ruflin pushed a commit that referenced this issue Oct 24, 2016
- Remove Elastica/Query/Filtered.php
- Remove test/Elastica/Query/FilteredTest.php
- Remove all references for filtered query from code
- Changelog update
@p365labs
Copy link
Collaborator

Hi @ruflin regarding this error
I have a look here https://www.elastic.co/guide/en/elasticsearch/reference/1.7/index-modules-merge.html, seems that merge_factor has been removed and the PolicyFactor has been deprecated since 1.6 elasticsearch version. I had a look at source code of ES and in ES5.0\ES5.x\master this feature is not present.
I've opened a PR --> #1192 for this

@p365labs
Copy link
Collaborator

dear @ruflin and @Zyqsempai I'm trying to help you too, if I can :) now I'm working on remove all the deprecations. I would like to understand better another point of this issue : "Double check which PHP versions should be supported" how do you want to deal with it ? If you have a look at here http://php.net/supported-versions.php, php 5.4 and 5.5 has been dropped active versions are 7.0 and 5.6 (active support will end januare the 2017). I will drop 5.4 for sure and evaluate dropping also 5.5, but leaving 5.6. What do u guess ?

@ruflin
Copy link
Owner Author

ruflin commented Oct 25, 2016

The above topics have been discussed here: https://gitter.im/ruflin/Elastica?at=580c7bc4305a10335db2114f

p365labs added a commit to p365labs/Elastica that referenced this issue Oct 28, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 9, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 9, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 9, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 9, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 9, 2016
ruflin pushed a commit that referenced this issue Nov 9, 2016
* fielddata_fields has been deprecated in ES5, use parameter docvalue_fields instead (#1184)

* Fix Set fielddata=true on [answer] (#1184)
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 9, 2016
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Nov 9, 2016
…m ElasticSearch 5.0

      - Changed "text" field to "prefix" in suggestions - changed in ElasticSearch 5.0
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 10, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 10, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 10, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 10, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 11, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 14, 2016
p365labs added a commit to p365labs/Elastica that referenced this issue Nov 16, 2016
ruflin pushed a commit that referenced this issue Nov 17, 2016
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Nov 18, 2016
…m ElasticSearch 5.0

      - Changed "text" field to "prefix" in suggestions - changed in ElasticSearch 5.0
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Nov 18, 2016
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Nov 19, 2016
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Nov 21, 2016
* fielddata_fields has been deprecated in ES5, use parameter docvalue_fields instead (ruflin#1184)

* Fix Set fielddata=true on [answer] (ruflin#1184)

Change to official docker image (ruflin#1210)

* Switch test environment to official docker image.
* Disable tests with multiple elasticsearch instances.

Update PHPUnit to the most recent version (ruflin#1211)

Prepare release 5.0.0-beta1 (ruflin#1212)

updated CompletionTest, payload and output are removed from completion suggester (ruflin#1184) (ruflin#1213)

store_fields it will no longer extract values from the _source, use mapping 'store' (ruflin#1184) (ruflin#1215)

update tests : use text or keyword instead of string and use boolean for store instaed yes/no (ruflin#1184) (ruflin#1218)

remove shutdown Node|Cluster as _shutdown has been removed (ruflin#1184) (ruflin#1220)

Squashed commits

      - Changed "text" field to "prefix" in suggestions - changed in ElasticSearch 5.0

      - Changed "text" field to "prefix" in suggestions - changed in ElasticSearch 5.0
Zyqsempai pushed a commit to Zyqsempai/Elastica that referenced this issue Nov 21, 2016
* fielddata_fields has been deprecated in ES5, use parameter docvalue_fields instead (ruflin#1184)

* Fix Set fielddata=true on [answer] (ruflin#1184)

Change to official docker image (ruflin#1210)

* Switch test environment to official docker image.
* Disable tests with multiple elasticsearch instances.

Update PHPUnit to the most recent version (ruflin#1211)

Prepare release 5.0.0-beta1 (ruflin#1212)

updated CompletionTest, payload and output are removed from completion suggester (ruflin#1184) (ruflin#1213)

store_fields it will no longer extract values from the _source, use mapping 'store' (ruflin#1184) (ruflin#1215)

update tests : use text or keyword instead of string and use boolean for store instaed yes/no (ruflin#1184) (ruflin#1218)

remove shutdown Node|Cluster as _shutdown has been removed (ruflin#1184) (ruflin#1220)

Squashed commits

      - Changed "text" field to "prefix" in suggestions - changed in ElasticSearch 5.0

      - Changed "text" field to "prefix" in suggestions - changed in ElasticSearch 5.0
@Tobion Tobion closed this as completed Feb 17, 2017
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

4 participants