本文整理汇总了Java中org.elasticsearch.action.admin.indices.open.OpenIndexRequest类的典型用法代码示例。如果您正苦于以下问题:Java OpenIndexRequest类的具体用法?Java OpenIndexRequest怎么用?Java OpenIndexRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenIndexRequest类属于org.elasticsearch.action.admin.indices.open包,在下文中一共展示了OpenIndexRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: indexConfig
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
/**
* 索引的相关操作
*
* @param indicesAdminClient
* @param indexName
* @throws IOException
*/
private static void indexConfig(IndicesAdminClient indicesAdminClient, String indexName) throws IOException {
//settings 设置
String settings = getIndexSetting();
// PUT /my_temp_index/_settings updatesettings
showIndexSettings(indicesAdminClient,indexName);
UpdateSettingsResponse updateSettingsResponse = indicesAdminClient.prepareUpdateSettings(indexName).setSettings(settings).execute().actionGet();
log.info("更新 index setting:{}", updateSettingsResponse);
//更新索引settings之前要关闭索引
indicesAdminClient.close(new CloseIndexRequest().indices(indexName)).actionGet();
//配置拼音自定义分析器
indicesAdminClient.prepareUpdateSettings(indexName).setSettings(getIndexPinYinSetting()).execute().actionGet();
//自定义分析器
indicesAdminClient.prepareUpdateSettings(indexName).setSettings(getIndexDemoSetting()).execute().actionGet();
//打开索引
indicesAdminClient.open(new OpenIndexRequest().indices(indexName)).actionGet();
//索引别名映射
createAliasIndex(indicesAdminClient);
showIndexSettings(indicesAdminClient,indexName);
}
开发者ID:ggj2010,项目名称:javabase,代码行数:31,代码来源:CrudDemo.java
示例2: prepareRequest
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
OpenIndexRequest openIndexRequest = new OpenIndexRequest(Strings.splitStringByCommaToArray(request.param("index")));
openIndexRequest.timeout(request.paramAsTime("timeout", openIndexRequest.timeout()));
openIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", openIndexRequest.masterNodeTimeout()));
openIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, openIndexRequest.indicesOptions()));
return channel -> client.admin().indices().open(openIndexRequest, new AcknowledgedRestListener<OpenIndexResponse>(channel));
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:RestOpenIndexAction.java
示例3: testOpenIndex
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
public void testOpenIndex() {
interceptTransportActions(OpenIndexAction.NAME);
OpenIndexRequest openIndexRequest = new OpenIndexRequest(randomUniqueIndicesOrAliases());
internalCluster().coordOnlyNodeClient().admin().indices().open(openIndexRequest).actionGet();
clearInterceptedActions();
assertSameIndices(openIndexRequest, OpenIndexAction.NAME);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:IndicesRequestIT.java
示例4: handleRequest
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
OpenIndexRequest openIndexRequest = new OpenIndexRequest(Strings.splitStringByCommaToArray(request.param("index")));
openIndexRequest.timeout(request.paramAsTime("timeout", openIndexRequest.timeout()));
openIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", openIndexRequest.masterNodeTimeout()));
openIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, openIndexRequest.indicesOptions()));
client.admin().indices().open(openIndexRequest, new AcknowledgedRestListener<OpenIndexResponse>(channel));
}
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:RestOpenIndexAction.java
示例5: should_open_index
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
@Test
public void should_open_index() throws Exception {
CloseIndexResponse closeIndexResponse = transportClient.admin().indices().close(new CloseIndexRequest(THE_INDEX)).actionGet();
Assertions.assertThat(closeIndexResponse.isAcknowledged()).isTrue();
OpenIndexResponse openIndexResponse = httpClient.admin().indices().open(new OpenIndexRequest(THE_INDEX)).get();
Assertions.assertThat(openIndexResponse.isAcknowledged()).isTrue();
transportClient.admin().indices().recoveries(new RecoveryRequest(THE_INDEX)).actionGet();
}
开发者ID:obourgain,项目名称:elasticsearch-http,代码行数:11,代码来源:OpenIndexActionHandlerTest.java
示例6: should_fail_when_no_index_specified
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
@Test
public void should_fail_when_no_index_specified() throws Exception {
CloseIndexResponse closeIndexResponse = transportClient.admin().indices().close(new CloseIndexRequest(THE_INDEX)).actionGet();
Assertions.assertThat(closeIndexResponse.isAcknowledged()).isTrue();
try {
httpClient.admin().indices().open(new OpenIndexRequest()).get();
} catch (Exception e) {
Assertions.assertThat(e).hasMessageContaining("ActionRequestValidationException");
Assertions.assertThat(e).hasMessageContaining("index is missing");
}
}
开发者ID:obourgain,项目名称:elasticsearch-http,代码行数:13,代码来源:OpenIndexActionHandlerTest.java
示例7: toXContent
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
@Override
protected XContentBuilder toXContent(OpenIndexRequest request, OpenIndexResponse response, XContentBuilder builder) throws IOException {
return builder.startObject()
.field(Fields.OK, true)
.field(Fields.ACKNOWLEDGED, response.isAcknowledged())
.endObject();
}
开发者ID:javanna,项目名称:elasticshell,代码行数:8,代码来源:OpenIndexRequestBuilder.java
示例8: open
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
@Override
public ActionFuture<OpenIndexResponse> open(final OpenIndexRequest request) {
return execute(OpenIndexAction.INSTANCE, request);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AbstractClient.java
示例9: openIndices
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
public ClusterState openIndices(ClusterState state, OpenIndexRequest request) {
return execute(transportOpenIndexAction, request, state);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:ClusterStateChanges.java
示例10: bootIndices
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
/**
* Boots up a previously closed index
*/
private void bootIndices(Client client) {
client.admin().indices().open(new OpenIndexRequest(
Settings.META_INDEX));
}
开发者ID:hopshadoop,项目名称:hopsworks,代码行数:9,代码来源:ElasticController.java
示例11: open
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
public void open(OpenIndexRequest request, ActionListener<OpenIndexResponse> listener) {
openIndexActionHandler.execute(request, listener);
}
开发者ID:obourgain,项目名称:elasticsearch-http,代码行数:4,代码来源:HttpIndicesAdminClient.java
示例12: OpenIndexRequestBuilder
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
public OpenIndexRequestBuilder(Client client, JsonToString<JsonInput> jsonToString, StringToJson<JsonOutput> stringToJson) {
super(client, new OpenIndexRequest(null), jsonToString, stringToJson);
}
开发者ID:javanna,项目名称:elasticshell,代码行数:4,代码来源:OpenIndexRequestBuilder.java
示例13: doExecute
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
@Override
protected ActionFuture<OpenIndexResponse> doExecute(OpenIndexRequest request) {
return client.admin().indices().open(request);
}
开发者ID:javanna,项目名称:elasticshell,代码行数:5,代码来源:OpenIndexRequestBuilder.java
示例14: open
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
/**
* Open an index based on the index name.
*
* @param request The close index request
* @return The result future
* @see org.elasticsearch.client.Requests#openIndexRequest(String)
*/
ActionFuture<OpenIndexResponse> open(OpenIndexRequest request);
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:IndicesAdminClient.java
示例15: openIndexRequest
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; //导入依赖的package包/类
/**
* Creates an open index request.
*
* @param index The index to open
* @return The delete index request
* @see org.elasticsearch.client.IndicesAdminClient#open(org.elasticsearch.action.admin.indices.open.OpenIndexRequest)
*/
public static OpenIndexRequest openIndexRequest(String index) {
return new OpenIndexRequest(index);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:Requests.java
注:本文中的org.elasticsearch.action.admin.indices.open.OpenIndexRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论