Skip to content

Instantly share code, notes, and snippets.

@henesgokdag
Created January 1, 2022 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henesgokdag/bf8992a7a6c278295feed22a51fd3e9e to your computer and use it in GitHub Desktop.
Save henesgokdag/bf8992a7a6c278295feed22a51fd3e9e to your computer and use it in GitHub Desktop.
@Configuration
public class ElasticClient extends AbstractElasticsearchConfiguration {
@Bean
public RestHighLevelClient elasticsearchClient() {
final ClientConfiguration clientConfiguration =
ClientConfiguration
.builder()
.connectedTo("localhost:9200")
.build();
return RestClients.create(clientConfiguration).rest();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment