【发布时间】:2018-02-01 02:40:04
【问题描述】:
我正在尝试配置 Spring Data Boot Sand ES 项目 在我的 pom.xml 我有:
@Configuration
@EnableElasticsearchRepositories(basePackages = "com.yoyo.elastic.repository")
public class ElasticConfiguration {
@Bean
public NodeBuilder nodeBuilder() {
return new NodeBuilder();
}
@Bean
public ElasticsearchOperations elasticsearchTemplate() throws IOException {
File tmpDir = File.createTempFile("elastic", Long.toString(System.nanoTime()));
System.out.println("Temp directory: " + tmpDir.getAbsolutePath());
final Client client = nodeBuilder().local(true).node().client();
return new ElasticsearchTemplate(client);
}
}
在我的 pom xml 中,我有这个 dep:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
这应该可以满足驱动程序,但我不断得到: 说明:
无法确定数据库类型 NONE 的嵌入式数据库驱动程序类
行动:
如果您想要一个嵌入式数据库,请在类路径中放置一个受支持的数据库。如果您要从特定配置文件加载数据库设置,您可能需要激活它(当前没有配置文件处于活动状态)。
【问题讨论】:
标签: spring-boot spring-data-elasticsearch