本文整理匯總了Java中org.springframework.data.elasticsearch.core.ElasticsearchTemplate.createIndex方法的典型用法代碼示例。如果您正苦於以下問題:Java ElasticsearchTemplate.createIndex方法的具體用法?Java ElasticsearchTemplate.createIndex怎麽用?Java ElasticsearchTemplate.createIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.data.elasticsearch.core.ElasticsearchTemplate
的用法示例。
在下文中一共展示了ElasticsearchTemplate.createIndex方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setElasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; //導入方法依賴的package包/類
@Autowired
public void setElasticsearchTemplate(ElasticsearchTemplate elasticsearchTemplate) {
this.elasticsearchTemplate = elasticsearchTemplate;
if(!elasticsearchTemplate.indexExists("uckefu")){
elasticsearchTemplate.createIndex("uckefu") ;
}
if(!elasticsearchTemplate.typeExists("uckefu" , "uc_ask_topiccomment")){
elasticsearchTemplate.putMapping(TopicComment.class) ;
}
}
示例2: setElasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; //導入方法依賴的package包/類
@Autowired
public void setElasticsearchTemplate(ElasticsearchTemplate elasticsearchTemplate) {
this.elasticsearchTemplate = elasticsearchTemplate;
if(!elasticsearchTemplate.indexExists("uckefu")){
elasticsearchTemplate.createIndex("uckefu") ;
}
if(!elasticsearchTemplate.typeExists("uckefu" , "uc_ask_message")){
elasticsearchTemplate.putMapping(Message.class) ;
}
}
示例3: setElasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; //導入方法依賴的package包/類
@Autowired
public void setElasticsearchTemplate(ElasticsearchTemplate elasticsearchTemplate) {
this.elasticsearchTemplate = elasticsearchTemplate;
if(!elasticsearchTemplate.indexExists("uckefu")){
elasticsearchTemplate.createIndex("uckefu") ;
}
if(!elasticsearchTemplate.typeExists("uckefu" , "uc_ask_topicview")){
elasticsearchTemplate.putMapping(TopicView.class) ;
}
}
示例4: setElasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; //導入方法依賴的package包/類
@Autowired
public void setElasticsearchTemplate(ElasticsearchTemplate elasticsearchTemplate) {
this.elasticsearchTemplate = elasticsearchTemplate;
if(!elasticsearchTemplate.indexExists(Topic.class)){
elasticsearchTemplate.createIndex(Topic.class) ;
}
if(!elasticsearchTemplate.typeExists("uckefu" , "uc_ask_topic")){
elasticsearchTemplate.putMapping(Topic.class) ;
}
}
示例5: cleanUpPersistentData
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; //導入方法依賴的package包/類
private void cleanUpPersistentData(ElasticsearchTemplate elasticsearchTemplate) {
LOG.debug("Cleaning up persistent data from Elasticsearch: deleting indices, creating new ones, put mappings, refresh indices");
elasticsearchTemplate.deleteIndex(PivioDocument.class);
elasticsearchTemplate.deleteIndex(Changeset.class);
elasticsearchTemplate.createIndex(PivioDocument.class);
elasticsearchTemplate.putMapping(PivioDocument.class);
elasticsearchTemplate.createIndex(Changeset.class);
elasticsearchTemplate.putMapping(Changeset.class);
refreshIndices();
}
示例6: elasticsearchTemplate
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; //導入方法依賴的package包/類
@Bean
public ElasticsearchTemplate elasticsearchTemplate() {
ElasticsearchTemplate template = new ElasticsearchTemplate(client());
if (!template.indexExists(User.class)) {
template.createIndex(User.class);
template.putMapping(User.class);
}
return template;
}