python 中ELasticsearch 连接池
摘要:import os import json from datetime import datetime from elasticsearch import Elasticsearch, RequestsHttpConnection from elasticsearch import Transpor
阅读全文
ES 嵌套字段、多字段去重
摘要:cardinality 去重 body={ "aggs": { "threat_name_aggs": { "cardinality": { "field": "alert.threat_name.keyword" } } }, "collapse":{ "field":"alert.threat_
阅读全文
elasticsearch 超10000 条数据查询、健康状态一直是黄色问题解决
摘要:ES单节点部署使用查询数据超10000条时,出现报错,后在查相关资料发现需要设置参数命令如下curl -H "Content-Type: application/json" -XPUT 127.0.0.1:9200/http_index/_settings?pretty -d '{"index.ma
阅读全文
ES 中多条件查询 匹配
摘要:近期使用ES做关联查询,实现 a and b and (c1 or c2)and (d1 or d2)的方法 被should 和must搞得晕头转向,后仔细拜读使用说明实现: GET gather-034-20171225/_search { "query": { "bool": { "must":
阅读全文
ES 并且或者查询
摘要:must should 的使用 GET /http_index/type/_search { "query": { "bool": { "should": [ { "bool": { "must": [ { "term" : { "field1" : { "value" : 110, "boost"
阅读全文
elasticsearch返回指定字段
摘要:1. 请求elasticsearch 返回指定字段 a._source指定需要返回的字段 { "_source":['title','id','desc'], "from":10, "size":100, } { "_source":{ "includes":["title","url","id"]
阅读全文
ES中search方法的使用
摘要:搜索所有数据 es.search(index="my_index",doc_type="test_type") # 或者 body = { "query":{ "match_all":{} } } es.search(index="my_index",doc_type="test_type",bod
阅读全文