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


Java PutMappingRequest.type方法代碼示例

本文整理匯總了Java中org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest.type方法的典型用法代碼示例。如果您正苦於以下問題:Java PutMappingRequest.type方法的具體用法?Java PutMappingRequest.type怎麽用?Java PutMappingRequest.type使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest的用法示例。


在下文中一共展示了PutMappingRequest.type方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: prepareRequest

import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; //導入方法依賴的package包/類
@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    PutMappingRequest putMappingRequest = putMappingRequest(Strings.splitStringByCommaToArray(request.param("index")));
    putMappingRequest.type(request.param("type"));
    putMappingRequest.source(request.content(), request.getXContentType());
    putMappingRequest.updateAllTypes(request.paramAsBoolean("update_all_types", false));
    putMappingRequest.timeout(request.paramAsTime("timeout", putMappingRequest.timeout()));
    putMappingRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putMappingRequest.masterNodeTimeout()));
    putMappingRequest.indicesOptions(IndicesOptions.fromRequest(request, putMappingRequest.indicesOptions()));
    return channel -> client.admin().indices().putMapping(putMappingRequest, new AcknowledgedRestListener<>(channel));
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:12,代碼來源:RestPutMappingAction.java

示例2: handleRequest

import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; //導入方法依賴的package包/類
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
    PutMappingRequest putMappingRequest = putMappingRequest(Strings.splitStringByCommaToArray(request.param("index")));
    putMappingRequest.type(request.param("type"));
    putMappingRequest.source(request.content().toUtf8());
    putMappingRequest.updateAllTypes(request.paramAsBoolean("update_all_types", false));
    putMappingRequest.reindex(request.paramAsBoolean("reindex", false));
    putMappingRequest.timeout(request.paramAsTime("timeout", putMappingRequest.timeout()));
    putMappingRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putMappingRequest.masterNodeTimeout()));
    putMappingRequest.indicesOptions(IndicesOptions.fromRequest(request, putMappingRequest.indicesOptions()));
    client.admin().indices().putMapping(putMappingRequest, new AcknowledgedRestListener<PutMappingResponse>(channel));
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:13,代碼來源:RestPutMappingAction.java

示例3: testCreateMapping

import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; //導入方法依賴的package包/類
@Test
public void testCreateMapping() throws Exception {
    PutMappingRequest putMappingRequest = new PutMappingRequest();
    putMappingRequest.indices("blog");
    putMappingRequest.type("");
    client.admin().indices().putMapping(putMappingRequest);
}
 
開發者ID:felayman,項目名稱:elasticsearch-full,代碼行數:8,代碼來源:IndexDemo.java

示例4: putMapping

import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; //導入方法依賴的package包/類
private static Request putMapping(final PutMappingRequest putMappingRequest) {
    final String endpoint = "/" + putMappingRequest.indices()[0] + "/_mapping/" + putMappingRequest.type();
    final ByteArrayEntity entity = new ByteArrayEntity(putMappingRequest.source().getBytes(),
            ContentType.APPLICATION_JSON);
    return new Request(HttpPut.METHOD_NAME, endpoint, Collections.emptyMap(), entity);
}
 
開發者ID:apache,項目名稱:metamodel,代碼行數:7,代碼來源:ElasticSearchRestClient.java


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