當前位置: 首頁>>代碼示例>>Java>>正文


Java ElasticsearchTemplate.createIndex方法代碼示例

本文整理匯總了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) ;
       }
   }
 
開發者ID:uckefu,項目名稱:uckefu,代碼行數:11,代碼來源:TopicCommentRepositoryImpl.java

示例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) ;
       }
   }
 
開發者ID:uckefu,項目名稱:uckefu,代碼行數:11,代碼來源:UKeFuRepositoryImpl.java

示例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) ;
       }
   }
 
開發者ID:uckefu,項目名稱:uckefu,代碼行數:11,代碼來源:TopicViewRepositoryImpl.java

示例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) ;
       }
   }
 
開發者ID:uckefu,項目名稱:uckefu,代碼行數:11,代碼來源:TopicRepositoryImpl.java

示例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();
}
 
開發者ID:pivio,項目名稱:pivio-server,代碼行數:15,代碼來源:AbstractApiTestCase.java

示例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;
}
 
開發者ID:przodownikR1,項目名稱:elasticSearchKata,代碼行數:12,代碼來源:ElasticCommon.java


注:本文中的org.springframework.data.elasticsearch.core.ElasticsearchTemplate.createIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。