Skip to content

Instantly share code, notes, and snippets.

@spati-java
Last active January 22, 2019 14:48
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 spati-java/0afc1916b99261ad006b1a5aef30f0f4 to your computer and use it in GitHub Desktop.
Save spati-java/0afc1916b99261ad006b1a5aef30f0f4 to your computer and use it in GitHub Desktop.
@Configuration
public class ElasticsearchConfig {
@Value("${elasticsearch.host}")
private String elasticsearchHost;
@Bean(destroyMethod = "close")
public RestHighLevelClient client() {
RestHighLevelClient client = new RestHighLevelClient(
RestClient.builder(new HttpHost(elasticsearchHost)));
return client;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment