按条件查询,将查询结果存储在文件中,size不能超过10000
curl -XPOST http://ipaddress:9200/incbdpiforder/orders/_search?pretty -d '
{
"query": {
"bool": {
"must": [
{
"term": {
"incDay": "20170502"
}
}
,
{
"term": {
"cityCode": "A440300000"
}
}
],
"must_not": [ ],
"should": [ ]
}
},
"from": 0,
"size": 600,
"sort": [ ],
"aggs": { }
}'>aa.txt
删除索引
curl -XDELETE http://10.202.8.122:9200/index?pretty
查看mapping
curl -XGET http://10.202.34.201:9200/inc/_mapping/orders?pretty
删除记录
curl -XDELETE 'http://10.202.34.201:9200/inc/history/_query?pretty' -d '
{"query": {
- "bool": {
- "must":
- {
- "match_all": { }
- }
- }
- }'
- {
- "must":
列出所有索引:
curl -XGET http://10.202.8.122:9200/_cat/indices?v
- 查看索引状态
curl -XGET http://10.202.8.122:9200/_cat/indices?v|grep inc
curl -XGET http://10.202.8.122:9200/_cat/indices?v|grep inc
集群健康状况
curl -XGET http://10.202.8.122:9200/_cluster/health?pretty
查看线程池大小
curl -XGET "http://10.202.34.201:9200/_nodes/thread_pool/"
修改线程池
- curl -XPUT '10.202.8.122:9200/_cluster/settings' -d '{
- "transient": {
- "threadpool.bulk.type": "fixed",
- "threadpool.bulk.size": 8,
- "threadpool.bulk.queue_size": 200
- }
- }'
查看前5sES数据
aa=`curl -XGET 'http://10.202.77.206:9200/incbdpiforder/_count' -d'
{
"query":{
"range": {
"timestamp":{
"gt": "now-5m",
"lt": "now"
}
}
}
}'`
切分结果,获取前5分钟写入ES的数据量
if [ $? -eq 0 ] ; then
echo $aa
#out=`echo $aa | awk -F ',' '{print $1;}' | awk -F ':' '{print $2;}'`
#echo $out
out1=` $aa | awk -F '[,:]' '{print $2;}'`
echo $out1
fi
~
添加字段
POST index/type/_update_by_query
{
"script":{
"lang":"painless",
"inline":"if (ctx._source.xx == null) {ctx._source.xx= 1.0}"
}
}