分布式搜索Elasticsearch 创建客户端(三)
原文链接:http://blog.csdn.net/geloin/article/details/8476614
IndicesAdminClient提供了针对索引的action的operation的管理进行操作的接口,它有以下方法:
1) exists(IndicesExistsRequest request)、exists(IndicesExistsRequest request, ActionListener<IndicesExistsResponse> listener)、prepareExists(String... indices),索引是否存在;2) typesExists(TypesExistsRequest request)、typesExists(TypesExistsRequest request, ActionListener<TypesExistsResponse> listener)、prepareTypesExists(String... index),type是否存在;
3) stats(IndicesStatsRequest request)、stats(IndicesStatsRequest request, ActionListener<IndicesStats> listener)、prepareStats(String... indices),索引统计;
4) status(IndicesStatusRequest request)、status(IndicesStatusRequest request, ActionListener<IndicesStatusResponse> listener)、prepareStatus(String... indices),索引状态;
5) segments(IndicesSegmentsRequest request)、segments(IndicesSegmentsRequest request, ActionListener<IndicesSegmentResponse> listener)、prepareSegments(String... indices),索引的段;
6) create(CreateIndexRequest request)、create(CreateIndexRequest request, ActionListener<CreateIndexResponse> listener)、prepareCreate(String index),基于显示的设置创建索引;
7) delete(DeleteIndexRequest request)、delete(DeleteIndexRequest request, ActionListener<DeleteIndexResponse> listener)、prepareDelete(String... indices),基于索引名称删除索引;
8) close(CloseIndexRequest request)、close(CloseIndexRequest request, ActionListener<CloseIndexResponse> listener)、prepareClose(String index),基于索引名称关闭索引;
9) open(OpenIndexRequest request)、open(OpenIndexRequest request, ActionListener<OpenIndexResponse> listener)、prepareOpen(String index),基于索引名称打开索引;
10) refresh(RefreshRequest request)、refresh(RefreshRequest request, ActionListener<RefreshResponse> listener)、prepareRefresh(String... indices),刷新索引;
11) flush(FlushRequest request)、flush(FlushRequest request, ActionListener<FlushResponse> listener)、prepareFlush(String... indices),刷新索引(从节点中释放内存);
12) optimize(OptimizeRequest request)、optimize(OptimizeRequest request, ActionListener<OptimizeResponse> listener)、prepareOptimize(String... indices),优化索引到片段中;
13) putMapping(PutMappingRequest request)、putMapping(PutMappingRequest request, ActionListener<PutMappingResponse> listener)、preparePutMapping(String... indices),定义映射关系,在这里可定义解析器,如paoding;
14) deleteMapping(DeleteMappingRequest request)、deleteMapping(DeleteMappingRequest request, ActionListener<DeleteMappingResponse> listener)、prepareDeleteMapping(String... indices),删除索引的映射;
16) aliases(IndicesAliasesRequest request)、aliases(IndicesAliasesRequest request, ActionListener<IndicesAliasesResponse> listener)、prepareAliases(),允许为索引添加或删除别名;
18) updateSettings(UpdateSettingsRequest request)、updateSettings(UpdateSettingsRequest request, ActionListener<UpdateSettingsResponse> listener)、prepareUpdateSettings(String... indices),为索引更新设置;
20) putTemplate(PutIndexTemplateRequest request)、putTemplate(PutIndexTemplateRequest request, ActionListener<PutIndexTemplateResponse> listener)、preparePutTemplate(String name),设置索引模板;
22) validateQuery(ValidateQueryRequest request)、validateQuery(ValidateQueryRequest request, ActionListener<ValidateQueryResponse> listener)、prepareValidateQuery(String... indices),验证查询的正确性;
24) deleteWarmer(DeleteWarmerRequest request)、deleteWarmer(DeleteWarmerRequest request, ActionListener<DeleteWarmerResponse> listener)、prepareDeleteWarmer(),删除候补索引。
25) GetIndexTemplatesRequestBuilder prepareGetTemplates(String... name); //获取索引模板,当name为*号时则获取所有
上一篇: 搜索工具everything的原理
推荐阅读
-
《ElasticSearch6.x实战教程》之简单搜索、Java客户端(上)
-
快速掌握分布式搜索引擎ElasticSearch(一)
-
【elasticsearch】三、搜索详解-全文搜索
-
Elasticsearch 5.X Java API 创建客户端
-
Elasticsearch搜索详解(三):返回字段筛选
-
Elasticsearch Java API 的使用(1)—创建客户端
-
使用“消息服务框架”(MSF)实现分布式事务的三阶段提交协议(电商创建订单的示例)
-
《ElasticSearch6.x实战教程》之简单搜索、Java客户端(上)
-
分布式搜索Elasticsearch源码分析之二------索引过程源码概要分析
-
Elasticsearch 创建客户端(二)