ElasticSearch 官网测试数据
发布日期:2021-07-28 08:29:50
浏览次数:2
分类:技术文章
本文共 1558 字,大约阅读时间需要 5 分钟。
一) 准备测试数据
去官网下载测试数据 二) 解压数据到目录 本次操作在虚拟中,我的解压地址是: 三)数据导入 3.1 打开Kibana的Dev Tools 3.2 创建三份测试数据对应的mapping //莎士比亚的mappingPUT /shakespeare{ "mappings": { "doc": { "properties": { "speaker": {"type": "keyword"}, "play_name": {"type": "keyword"}, "line_id": {"type": "integer"}, "speech_number": {"type": "integer"} } } }//log的测试数据的mappingPUT /logstash-2019.01.21{ "mappings": { "log": { "properties": { "geo": { "properties": { "coordinates": { "type": "geo_point" } } } } } }}PUT /logstash-2019.01.20{ "mappings": { "log": { "properties": { "geo": { "properties": { "coordinates": { "type": "geo_point" } } } } } }}PUT /logstash-2019.01.22{ "mappings": { "log": { "properties": { "geo": { "properties": { "coordinates": { "type": "geo_point" } } } } } }}
执行上面的语句
执行结果 导入数据: WINDOWS: 在任意地方启动cmd,输入下面命令 linux :进入任意目录-
(前提是安装了curl)
-
官网给的是单引号,但是单引号在win系统下运行会出错,改成双引号就好了。
-
而且这一句-H "Content-Type: application/x-ndjson"是必须要有的
- curl -H “Content-Type: application/x-ndjson” -XPOST “192.168.6.66:9200/shakespeare/doc/_bulk?pretty” --data-binary @shakespeare_6.0.json curl -H “Content-Type: application/x-ndjson” -XPOST “192.168.6.66:9200/bank/account/_bulk?pretty” --data-binary @accounts.json curl -H “Content-Type: application/x-ndjson” -XPOST “192.168.6.66:9200/_bulk?pretty” --data-binary @logs.jsonl
转载地址:https://blog.csdn.net/sinat_17775997/article/details/116132070 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
做的很好,不错不错
[***.243.131.199]2024年03月22日 00时21分57秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
【Leetcode刷题篇】leetcode451根据字符出现频率排序
2019-04-26
【Leetcode刷题篇】leetcode703 数据流中的第k大元素
2019-04-26
【Leetcode刷题篇】leetcode378 有序矩阵中第K小的元素
2019-04-26
【Leetcode刷题篇】前K个高频元素
2019-04-26
【Leetcode刷题篇】leetcode373 查找和最小的K对数字
2019-04-26
【Leetcode刷题篇】leetcode367 有效的完全平方数
2019-04-26
【Leetcode刷题篇】剑指offer-数值的整数次方
2019-04-26
【Leetcode刷题篇】面试题01.06 字符串压缩
2019-04-26
【Leetcode刷题篇】leetcode443 压缩字符串
2019-04-26
【面试篇】数据结构-线性表
2019-04-26
【面试篇】数据结构-树形结构
2019-04-26
【面试篇】数据结构-哈希表
2019-04-26
【Leetcode刷题篇】leetcode88 合并两个有序数组
2019-04-26
【Leetcode刷题篇】剑指offer51 数组中的逆序对
2019-04-26
【Leetcode刷题篇】剑指offer55-平衡二叉树
2019-04-26
【Leetcode刷题篇】leetcode98 判断一棵树是否为二叉搜索树
2019-04-26
Java中arraylist和数组的相互转换
2019-04-26
【Leetcode刷题篇 】leetcode147 对链表进行插入排序
2019-04-26
【Leetcode刷题篇】leetcode148 排序链表
2019-04-26