Netflix / conductor-community

Apache License 2.0
61 stars 72 forks source link

Fix search on es7-persistence #170

Closed BirknerAlex closed 1 year ago

BirknerAlex commented 1 year ago

Pull Request type

Changes in this PR

Currently when using the es7-persistence index plugin no workflows will be returned from the search since the query to Elasticsearch isn't correct for ES7 and contains the deprecated _type field in the request URI.

See also: https://www.elastic.co/guide/en/elasticsearch/reference/7.17/removal-of-types.html

Before the change the workflow query will be build something like:

http://127.0.0.1:9200/conductor_workflow/workflow/_search?typed_keys=true&max_concurrent_shard_requests.....

After the change, the URL looks like:

http://127.0.0.1:9200/conductor_workflow/_search?typed_keys=true&max_concurrent_shard_request.....

The Elasticsearch _search API still supports the _types but when indexing new objects the provided type can no longer be defined and will be ignored. All newly added documents do have the type _doc now and no longer workflow.

This change should be backwards compatible to existing documents when upgrading from ES6 to ES7.

I also added the plugin to the gradle.build file and fixed the corresponding lock files as well. In my case it has worked to still include the upstream es6-persistence plugin as well the es7-persistence plugin.

DukeDai commented 1 year ago

Thanks, hope this can be released early as possible(I must use a local jar to workaround this)