All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.heanbian.boot.autoconfigure.elasticsearch.ElasticsearchAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 20200807
Show newest version
package com.heanbian.boot.autoconfigure.elasticsearch;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.heanbian.block.elasticsearch.client.ElasticsearchTemplate;

@Configuration
@EnableConfigurationProperties(ElasticsearchProperties.class)
public class ElasticsearchAutoConfiguration {

	@Bean
	@ConditionalOnProperty(prefix = "heanbian.elasticsearch", name = "enabled", havingValue = "true")
	public ElasticsearchTemplate elasticsearchTemplate(ElasticsearchProperties ep) {
		return new ElasticsearchTemplate(ep.getClusterNodes());
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy