es helper 介绍 | 学习笔记

简介: 快速学习 es helper 介绍

开发者学堂课程【ElasticSearch 入门精讲es helper 介绍学习笔记,与课程紧密连接,让用户快速学习知识。

课程地址https://developer.aliyun.com/learning/course/631/detail/9987


es helper 介绍


使用 Helper 方式新增索引

*/

@Test

public void testNewAddIndexHelperWay( throws l0Exception {

System. out.printIn("正式开始使用[使用 Helper 方式新增索引]了...;XContentBuilder xContentBuilder = XContentFactory. contentBuilder(XContentType.JSOM

.startObject()

.field( name: "name", value: "sqoop")

.field( name: "author", value: "小鱼儿”)

.field( name: "version", value: "2.1.1")

.endObject();IndexResponse response = client.preparelndex(INDEX, TYP).setSource(xContentBuilder).get();

System. outprintf("待新增的索引信息是: %s, es 集群反馈的结果是: %s%n" ',xContentBuilder,response.toString();

相关文章
|
6月前
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
400 0
|
6月前
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
|
资源调度
Cannot find module ‘\node_modules\ejs\postinstall.js
Cannot find module ‘\node_modules\ejs\postinstall.js
125 0
|
6月前
Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.
Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.
73 2
|
6月前
|
应用服务中间件 nginx
项目node_modules开发环境变大问题处理
项目node_modules开发环境变大问题处理
155 0
|
6月前
|
JavaScript IDE 开发工具
es6学习笔记(一)let、const
es6学习笔记(一)let、const
|
6月前
|
前端开发
node+express+ multer 实现文件上传入门
node+express+ multer 实现文件上传入门
|
JavaScript
Node.js Error: Cannot find module express
Node.js Error: Cannot find module express
node Express.js node:internal/modules/cjs/loader:988 throw err; ^ Error: Cannot find module ‘
node Express.js node:internal/modules/cjs/loader:988 throw err; ^ Error: Cannot find module ‘
1106 0
node Express.js node:internal/modules/cjs/loader:988 throw err; ^ Error: Cannot find module ‘
|
11月前
【Error】This dependency was not found: * core-js/modules/es.error.cause.js in ./node_modules/@babel
【Error】This dependency was not found: * core-js/modules/es.error.cause.js in ./node_modules/@babel
下一篇
无影云桌面