本文整理汇总了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());
}
示例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;
}
示例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;
}
示例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);
}
示例5: elasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
public ElasticsearchOperations elasticsearchTemplate() throws Exception {
return new ElasticsearchTemplate(client());
}
示例6: elasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
public ElasticsearchOperations elasticsearchTemplate() throws NumberFormatException, UnknownHostException {
return new ElasticsearchTemplate(client());
}
示例7: elasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public ElasticsearchOperations elasticsearchTemplate(JestClient client) {
return new JestElasticsearchTemplate(client);
}
示例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;
}
示例11: elasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
public ElasticsearchOperations elasticsearchTemplate() {
return new ElasticsearchTemplate(client());
}
示例12: elasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
public ElasticsearchOperations elasticsearchTemplate() {
return new ElasticsearchTemplate(NodeBuilder.nodeBuilder().local(true).node().client());
}
示例13: elasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchOperations; //导入依赖的package包/类
@Bean
public ElasticsearchOperations elasticsearchTemplate() {
return new ElasticsearchTemplate(NodeBuilder.nodeBuilder().local(true).node()
.client());
}