ELK中elasticsearch的用法
来源:互联网 发布:喜纳昌吉 知乎 编辑:程序博客网 时间:2024/06/05 23:51
1、查询gather-005中 NAME='Lihua'
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"query":{
"match":{
"NAME":"Lihua"
}
}
}'
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"size":10,
"query":{
"term":{
"NAME.keyword":"Lihua"
}
}
}'
2、查询 gather-010中前两个
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"size":2
}
3、查询gather-000中area_type为0的前1个
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"size":1,
"query":{
"term":{
"NAME.keyword":"Lihua"
}
}
}'
4、创建一个index
curl -XPUT 'localhost:9200/customer?pretty&pretty'
5、查看所有的index
curl -XGET 'localhost:9200/_cat/indices?v&pretty'
6、创建一个document domain/{index}/{type}/id
curl -XPUT 'localhost:9200/customer/external/1?pretty&pretty' -d'
{
"name":"Li hua"
}
7、删除customer索引
curl -XDELETE 'localhost:9200/customer?pretty'
8、
curl -XPOST 'localhost:9200/customer/external?pretty&pretty' -d'
{
"name": "Jane Doe"
}'
更新:
curl -XPOST 'localhost:9200/customer/external/1/_update?pretty&pretty' -d'
{
"doc": { "name": "Jane Doe" }
}'
命令的格式:
<REST Verb> /<Index>/<Type>/<ID>
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"aggs":{
"newtype":{
"terms":{
"field":"NAME.keyword",
"size":100
}
}
}
}'
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"size":10,
"query":{
"term":{"area_type.keyword":"1"}
},
"aggs":{
"newtype":{
"terms":{
"field":"NAME.keyword",
"size":100
}
}
}
}'
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"query":{
"match":{
"NAME":"Lihua"
}
}
}'
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"size":10,
"query":{
"term":{
"NAME.keyword":"Lihua"
}
}
}'
2、查询 gather-010中前两个
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"size":2
}
3、查询gather-000中area_type为0的前1个
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"size":1,
"query":{
"term":{
"NAME.keyword":"Lihua"
}
}
}'
4、创建一个index
curl -XPUT 'localhost:9200/customer?pretty&pretty'
5、查看所有的index
curl -XGET 'localhost:9200/_cat/indices?v&pretty'
6、创建一个document domain/{index}/{type}/id
curl -XPUT 'localhost:9200/customer/external/1?pretty&pretty' -d'
{
"name":"Li hua"
}
7、删除customer索引
curl -XDELETE 'localhost:9200/customer?pretty'
8、
curl -XPOST 'localhost:9200/customer/external?pretty&pretty' -d'
{
"name": "Jane Doe"
}'
更新:
curl -XPOST 'localhost:9200/customer/external/1/_update?pretty&pretty' -d'
{
"doc": { "name": "Jane Doe" }
}'
命令的格式:
<REST Verb> /<Index>/<Type>/<ID>
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"aggs":{
"newtype":{
"terms":{
"field":"NAME.keyword",
"size":100
}
}
}
}'
curl -XGET 'localhost:9200/gather-005/_search?pretty' -H 'Content-Type:application/json' -d'
{
"size":10,
"query":{
"term":{"area_type.keyword":"1"}
},
"aggs":{
"newtype":{
"terms":{
"field":"NAME.keyword",
"size":100
}
}
}
}'
阅读全文
0 0
- ELK中elasticsearch的用法
- ELK -elasticsearch
- ELK中Kibana4中Elasticsearch的UTC时间误差八小时的处理方法
- ELK弹性堆栈的心脏--Elasticsearch
- ELK (Elasticsearch+Logstash+Kibana) 的安装
- elasticsearch中aggregation的简单用法
- elasticsearch elk资料
- ELK(五)ElasticSearch常用命令
- ELK(六)ElasticSearch索引
- ELK(七)ElasticSearch搜索
- ElasticSearch——ELK
- ELK之ElasticSearch
- ELK(二)ElasticSearch
- ELK-ElasticSearch+Logstash+Kibana
- ELK第二篇:Elasticsearch的CRUD常用REST接口
- windows下ELK(ElasticSearch、Logstash、Kibana)环境的搭建
- elk安装及使用一(elk的概述及elasticsearch安装)
- ELK中logstash的使用
- 出现对实体 "useSSL" 的引用必须以 ';' 分隔符结尾。的解决办法
- UML类图
- 面试题七 C/C++ 两个字符串由数字组成的相加,最大不超过32bit整形的系统函数--程序员面试题
- 【二分图】poj 2536 Gopher II
- javascript深入理解js闭包
- ELK中elasticsearch的用法
- iOS NSNotification(通知)传值~demo
- eclipse编译过程出现堆栈溢出情况
- git删除二进制文件
- MPAndroidCharts:解决“禁用图例,直接禁用X轴会显示不全”的问题
- 2.0版vue.js 路由原理
- 转换器和格式化
- 剑指offer--37两个单链表的第一个公共节点
- po2406Power Strings