当前位置: 首页>>代码示例>>Java>>正文


Java ElasticsearchOperations类代码示例

本文整理汇总了Java中org.springframework.data.elasticsearch.core.ElasticsearchOperations的典型用法代码示例。如果您正苦于以下问题:Java ElasticsearchOperations类的具体用法?Java ElasticsearchOperations怎么用?Java ElasticsearchOperations使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ElasticsearchOperations类属于org.springframework.data.elasticsearch.core包,在下文中一共展示了ElasticsearchOperations类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: elasticsearchTemplate

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
ElasticsearchOperations elasticsearchTemplate() throws IOException {

	// transport client
	Settings settings = ImmutableSettings.settingsBuilder()
	        .put("cluster.name", "elasticsearch")
	        .put("username","myname")
	        .put("password","mypassword").build();
	        
	 Client client = new TransportClient(settings)
        .addTransportAddress(new InetSocketTransportAddress("192.168.73.186", 9300));
	 
	 return new ElasticsearchTemplate(client);

	// node client
	//		return new ElasticsearchTemplate(nodeBuilder()
	//				.local(true)
	//				.settings(
	//						ImmutableSettings.settingsBuilder()
	//								.put("cluster.name", "elasticsearch")
	//								.put("username", "myname")
	//								.put("password", "mypassword").build()).node()
	//				.client());
}
 
开发者ID:phstudy,项目名称:SpringMVC-SpringDataElasticsearch,代码行数:25,代码来源:ElasticsearchConfig.java

示例2: PropertyServiceImpl

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Autowired
public PropertyServiceImpl(//
        final PropertyRepository propertyRepository, //
        final AgentRepository agentRepository, //
        final ElasticsearchOperations elasticsearchOperations, //
        final RestTemplate restTemplate //
) {
    this.propertyRepository = propertyRepository;
    this.agentRepository = agentRepository;
    this.elasticsearchOperations = elasticsearchOperations;
    this.restTemplate = restTemplate;
}
 
开发者ID:gustavoorsi,项目名称:searchahouse.com,代码行数:13,代码来源:PropertyServiceImpl.java

示例3: AgentServiceImpl

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Autowired
public AgentServiceImpl(//
        final AgentRepository agentRepository, //
        final ElasticsearchOperations elasticsearchOperations //
) {
    this.agentRepository = agentRepository;
    this.elasticsearchOperations = elasticsearchOperations;
}
 
开发者ID:gustavoorsi,项目名称:searchahouse.com,代码行数:9,代码来源:AgentServiceImpl.java

示例4: setUp

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	ctx = new AnnotationConfigApplicationContext(ElasticSearchConfig.class);

	elasticsearchOperations = ctx.getBean(ElasticsearchOperations.class);
	posts = ctx.getBean(PostRepository.class);

}
 
开发者ID:hantsy,项目名称:spring4-sandbox,代码行数:9,代码来源:PostRepositoryTest.java

示例5: elasticsearchTemplate

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
public ElasticsearchOperations elasticsearchTemplate() throws Exception {
    return new ElasticsearchTemplate(client());
}
 
开发者ID:chanakaDe,项目名称:ensembl-elastic-rest-final,代码行数:5,代码来源:EsConfig.java

示例6: elasticsearchTemplate

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
public ElasticsearchOperations elasticsearchTemplate() throws NumberFormatException, UnknownHostException {
	return new ElasticsearchTemplate(client());
}
 
开发者ID:gov-ithub,项目名称:romanescU-spring-api,代码行数:5,代码来源:Application.java

示例7: elasticsearchTemplate

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public ElasticsearchOperations elasticsearchTemplate(JestClient client) {
	return new JestElasticsearchTemplate(client);
}
 
开发者ID:VanRoy,项目名称:spring-data-jest,代码行数:6,代码来源:ElasticsearchJestDataAutoConfiguration.java

示例8: setElasticsearchOperations

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
public void setElasticsearchOperations(ElasticsearchOperations operations) {
  super.setElasticsearchOperations(operations);
  this.operations = operations;
}
 
开发者ID:lordlothar99,项目名称:strategy-spring-security-acl,代码行数:5,代码来源:AclElasticsearchRepositoryFactoryBean.java

示例9: Factory

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
public Factory(ElasticsearchOperations elasticsearchOperations) {
  super(elasticsearchOperations);
  this.elasticsearchOperations = elasticsearchOperations;
}
 
开发者ID:lordlothar99,项目名称:strategy-spring-security-acl,代码行数:5,代码来源:AclElasticsearchRepositoryFactoryBean.java

示例10: AclElasticsearchRepository

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
public AclElasticsearchRepository(ElasticsearchEntityInformation<T, ID> metadata,
    ElasticsearchOperations elasticsearchOperations, AclFilterProvider filterProvider) {
  super(metadata, elasticsearchOperations);
  this.filterProvider = filterProvider;
}
 
开发者ID:lordlothar99,项目名称:strategy-spring-security-acl,代码行数:6,代码来源:AclElasticsearchRepository.java

示例11: elasticsearchTemplate

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
public ElasticsearchOperations elasticsearchTemplate() {
    return new ElasticsearchTemplate(client());
}
 
开发者ID:clive-jevons,项目名称:mqtt-elasticsearch-forwarding,代码行数:5,代码来源:ElasticSearchConfiguration.java

示例12: elasticsearchTemplate

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
public ElasticsearchOperations elasticsearchTemplate() {
	return new ElasticsearchTemplate(NodeBuilder.nodeBuilder().local(true).node().client());
}
 
开发者ID:hantsy,项目名称:spring4-sandbox,代码行数:5,代码来源:ElasticSearchConfig.java

示例13: elasticsearchTemplate

import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
  public ElasticsearchOperations elasticsearchTemplate() {
return new ElasticsearchTemplate(NodeBuilder.nodeBuilder().local(true).node()
		.client());
  }
 
开发者ID:hantsy,项目名称:spring4-sandbox,代码行数:6,代码来源:ElasticSearchConfig.java


注:本文中的org.springframework.data.elasticsearch.core.ElasticsearchOperations类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。