'how to migrate from spring-date-elasticsearch 3.x to 4.3

Application is on old spring-date-elasticsearch 3.x. It uses ElasticsearchRepository with TransportClient. The goal is to migrate to latest spring-date-elasticsearch 4.3. I am thinking to use RestHighLevelClient for both ElasticSearchRepository and ElasticSearchOperation(since search is being removed from ElasticSearchRepository).

Here is what I did:

  1. I updated with new version jar;
  2. Removed "spring.data.elasticsearch.*" property.
  3. Removed TransportClient bean;
  4. Added in RestHighLevelClient and ElasticSearchOperation bean.

But somehow microsoft applicationinsights couldn't start. Not sure how that was related to spring-data-elasticsearch.

Then I am trying to migrate from TransportClient to RestHighLevelClient in current 3.x first. I didn't update with new version jar. But I keep all the other changes. But then it still tries to instantiate [org.elasticsearch.client.transport.TransportClient] in ElasticsearchAutoConfiguration.java.

I don't feel I am going in the right direction. Please advise.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source