| | |
| | | "basic.com/pubsub/protomsg.git" |
| | | ) |
| | | |
| | | var logPrint = func(i ...interface{}) { |
| | | fmt.Println(i) |
| | | } |
| | | |
| | | func InitLog(fn func(i ...interface{})) { |
| | | if fn != nil { |
| | | logPrint = fn |
| | | } |
| | | } |
| | | |
| | | // 根据抓拍人员id查询抓拍人员信息 |
| | | func AIOceaninfosbyid(id []string, indexName string, serverIp string, serverPort string) ([]protomsg.AIOcean, error) { |
| | | var aIOceanInfo []protomsg.AIOcean |
| | |
| | | } |
| | | |
| | | aIOcean := AIOceanAnalysis(sources) |
| | | println(aIOcean) |
| | | return aIOcean, nil |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | }` |
| | | fmt.Println(jsonDSL) |
| | | logPrint(jsonDSL) |
| | | buf, err := EsReq("POST", url, []byte(jsonDSL)) |
| | | if err != nil { |
| | | return "", err |
| | | } |
| | | json.Unmarshal(buf, &info) |
| | | out, ok := info.(map[string]interface{}) |
| | | fmt.Println(out) |
| | | logPrint(out) |
| | | if !ok { |
| | | return "", errors.New("http response interface can not change map[string]interface{}") |
| | | } |
| | |
| | | } |
| | | return mes, nil |
| | | |
| | | } |
| | | |
| | | //根据摄像机列表和时间查询人员浏览轨迹 |
| | | func GetPersonDataByCameraIdAndTime(cameraId []string, startTime string, endTime string, serverIp string, ServerPort string, indexName string) ([]map[string]interface{}, error) { |
| | | esCameraId := strings.Replace(strings.Trim(fmt.Sprint(cameraId), "[]"), " ", "\",\"", -1) |
| | | personUrl := "http://" + serverIp + ":" + ServerPort + "/" + indexName + "/_search" |
| | | personBody := `{ |
| | | "query": { |
| | | "bool": { |
| | | "filter": [ |
| | | { |
| | | "range": { |
| | | "picDate": { |
| | | "gte": "` + startTime + `", |
| | | "lte": "` + endTime + `" |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | "term": { |
| | | "targetInfo.targetType.raw": "Yolo" |
| | | } |
| | | }, |
| | | { |
| | | "terms": { |
| | | "cameraId": [ |
| | | "` + esCameraId + `" |
| | | ] |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | "size": 2147483647, |
| | | "_source": { |
| | | "includes": [ |
| | | "cameraId", |
| | | "cameraName", |
| | | "cameraAddr", |
| | | "targetInfo.targetScore", |
| | | "picDate", |
| | | "updateTime", |
| | | "picMaxUrl", |
| | | "targetInfo.belongsTargetId", |
| | | "targetInfo.targetLocation", |
| | | "picWH" |
| | | ] |
| | | } |
| | | }` |
| | | //fmt.Println(personUrl) |
| | | //fmt.Println(personBody) |
| | | buf, err := EsReq("POST", personUrl, []byte(personBody)) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | |
| | | sources, err := Sourcelist(buf) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | resData,err := PerSonAnalysis(sources) |
| | | //println(sources) |
| | | return resData, nil |
| | | |
| | | } |
| | | |
| | | //根据时间范围,摄像机列表,分组聚合人脸列表 |
| | | func GetFaceDataBucketsByCameraIdAndTime(cameraId []string, startTime string, endTime string, thresholdTime float64, serverIp string, ServerPort string, indexName string) (buckersDate map[string]interface{}, err error) { |
| | | esCameraId := strings.Replace(strings.Trim(fmt.Sprint(cameraId), "[]"), " ", "\",\"", -1) |
| | | var buckersUrl = "http://" + serverIp + ":" + ServerPort + "/" + indexName + "/_search" |
| | | var buckersBody = `{ |
| | | "query": { |
| | | "bool": { |
| | | "filter": [ |
| | | { |
| | | "range": { |
| | | "picDate": { |
| | | "gte": "` + startTime + `", |
| | | "lte": "` + endTime + `" |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | "term": { |
| | | "targetInfo.targetType.raw": "FaceDetect" |
| | | } |
| | | }, |
| | | { |
| | | "terms": { |
| | | "cameraId": ["` + esCameraId + `"] |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | "size": 0, |
| | | "aggs": { |
| | | "buckets_aggs": { |
| | | "composite": { |
| | | "sources": [ |
| | | { |
| | | "baseInfo.targetId": { |
| | | "terms": { |
| | | "field": "baseInfo.targetId" |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | "cameraId": { |
| | | "terms": { |
| | | "field": "cameraId" |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | "size": 100000000 |
| | | }, |
| | | "aggs":{ |
| | | "top_attention_hits":{ |
| | | "top_hits":{ |
| | | "size": 1000000, |
| | | "sort": [ |
| | | { |
| | | "picDate": { |
| | | "order": "asc" |
| | | } |
| | | } |
| | | ], |
| | | "_source":{ |
| | | "includes":["baseInfo.targetId","cameraId","cameraName","cameraAddr","targetInfo.targetScore","targetInfo.picSmUrl","showLabels","baseInfo.tableId","baseInfo.tableName","baseInfo.bwType","baseInfo.targetName","baseInfo.compareScore","picDate","picMaxUrl","picWH"] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }` |
| | | //fmt.Println(buckersUrl) |
| | | //fmt.Println(buckersBody) |
| | | buf, err := EsReq("POST", buckersUrl, []byte(buckersBody)) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | |
| | | sources, err := SourceAggregations(buf, thresholdTime) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | //println(sources) |
| | | return sources, nil |
| | | } |
| | | |
| | | //根据抓拍人员id更新(picurl)图片地址 |
| | | func UpdatePicUrlById(id string, picUrl string, indexName string, serverIp string, serverPort string) (err error) { |
| | | updateTime := time.Now().Format("2006-01-02 15:04:05") |
| | | tRes, err := AIOceaninfosbyid([]string{id}, indexName, serverIp, serverPort) |
| | | if err != nil || len(tRes) == 0 { |
| | | return err |
| | | } |
| | | picMaxUrls := tRes[0].PicMaxUrl |
| | | sourceStr := ` |
| | | "lang":"painless", |
| | | "inline": "ctx._source.picMaxUrl.add('` + picUrl + `');ctx._source.updateTime='`+updateTime+`'" |
| | | ` |
| | | if len(picMaxUrls) >= 2 { |
| | | sourceStr = `"source": "ctx._source.picMaxUrl[1]='` + picUrl + `';ctx._source.updateTime='`+updateTime+`'"` |
| | | } |
| | | var info interface{} |
| | | url := "http://" + serverIp + ":" + serverPort + "/" + indexName + "/_update_by_query?refresh=true" |
| | | |
| | | var picUrlInfo = ` |
| | | { |
| | | "script": { |
| | | ` + sourceStr + ` |
| | | }, |
| | | "query": { |
| | | "bool": { |
| | | "filter": [ |
| | | { |
| | | "term": { |
| | | "id": "` + id + `" |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | ` |
| | | //logPrint("url: ", url, videoUrlInfo) |
| | | fmt.Println(url, picUrlInfo) |
| | | buf, err := EsReq("POST", url, []byte(picUrlInfo)) |
| | | if err != nil { |
| | | logPrint("http request videoUrlInfo info is err!") |
| | | return err |
| | | } |
| | | json.Unmarshal(buf, &info) |
| | | //logPrint(info) |
| | | out, ok := info.(map[string]interface{}) |
| | | if !ok { |
| | | logPrint("http response interface can not change map[string]interface{}") |
| | | return errors.New("http response interface can not change map[string]interface{}") |
| | | } |
| | | middle, ok := out["updated"].(float64) |
| | | if !ok { |
| | | logPrint("first updated change error!") |
| | | return errors.New("first updated change error!") |
| | | } |
| | | if middle == 1 { |
| | | return nil |
| | | } |
| | | if middle == 0 { |
| | | return errors.New("已经修改") |
| | | } |
| | | return nil |
| | | } |
| | | |
| | | //根据抓拍人员id更新(videourl)摄像机地址 |
| | |
| | | } |
| | | } |
| | | ` |
| | | //fmt.Println("url: ", url, videoUrlInfo) |
| | | //logPrint("url: ", url, videoUrlInfo) |
| | | buf, err := EsReq("POST", url, []byte(videoUrlInfo)) |
| | | if err != nil { |
| | | fmt.Println("http request videoUrlInfo info is err!") |
| | | logPrint("http request videoUrlInfo info is err!") |
| | | statu = 500 |
| | | return statu, err |
| | | } |
| | | json.Unmarshal(buf, &info) |
| | | //fmt.Println(info) |
| | | //logPrint(info) |
| | | out, ok := info.(map[string]interface{}) |
| | | if !ok { |
| | | fmt.Println("http response interface can not change map[string]interface{}") |
| | | logPrint("http response interface can not change map[string]interface{}") |
| | | statu = 500 |
| | | return statu, errors.New("http response interface can not change map[string]interface{}") |
| | | } |
| | | middle, ok := out["updated"].(float64) |
| | | if !ok { |
| | | fmt.Println("first updated change error!") |
| | | logPrint("first updated change error!") |
| | | statu = 500 |
| | | return statu, errors.New("first updated change error!") |
| | | } |
| | |
| | | "\"size\":\"1000\"," + |
| | | "\"query\":{\"bool\":{" + queryStr + |
| | | "\"filter\":[" + |
| | | "{\"term\":{\"targetInfo.targetType.raw\":\"face\"}}," + |
| | | "{\"term\":{\"targetInfo.targetType.raw\":\"FaceDetect\"}}," + |
| | | cameraIdStr + |
| | | alarmLevelStr + |
| | | taskIdStr + |
| | |
| | | go func(reqParam string) { |
| | | defer wg.Done() |
| | | |
| | | //fmt.Println(url) |
| | | //fmt.Println(prama) |
| | | logPrint(url) |
| | | logPrint(prama) |
| | | buf, err := EsReq("POST", url, []byte(reqParam)) |
| | | |
| | | if err != nil { |
| | | fmt.Println("http request videoUrlInfo info is err!") |
| | | fmt.Println(len(capturetable)) |
| | | logPrint("http request videoUrlInfo info is err!") |
| | | logPrint(len(capturetable)) |
| | | return |
| | | } |
| | | |
| | | sources, err := Sourcelistforscroll(buf) |
| | | |
| | | if err != nil { |
| | | fmt.Println(len(capturetable)) |
| | | logPrint(len(capturetable)) |
| | | return |
| | | } |
| | | for _, source := range sources["sourcelist"].([]map[string]interface{}) { |
| | |
| | | "scroll": "1m", |
| | | "scroll_id" : "` + scroll_id + `" |
| | | }` |
| | | //fmt.Println(scroll_url) |
| | | //fmt.Println(jsonDSL) |
| | | logPrint(scroll_url) |
| | | logPrint(jsonDSL) |
| | | buf, err := EsReq("POST", scroll_url, []byte(jsonDSL)) |
| | | |
| | | if err != nil { |
| | | fmt.Println("lenth1: ", len(capturetable)) |
| | | logPrint("lenth1: ", len(capturetable)) |
| | | return |
| | | } |
| | | nextSources, err := Sourcelistforscroll(buf) |
| | |
| | | } |
| | | |
| | | nextM := nextSources["sourcelist"].([]map[string]interface{}) |
| | | //fmt.Println("id",nextSources) |
| | | //logPrint("id",nextSources) |
| | | if nextM == nil || len(nextM) == 0 { |
| | | //fmt.Println("lenth: ", len(capturetable)) |
| | | //logPrint("lenth: ", len(capturetable)) |
| | | return |
| | | } |
| | | //fmt.Println("id") |
| | | //logPrint("id") |
| | | for _, source := range nextM { |
| | | tmpList = append(tmpList, source["id"].(string)) |
| | | } |
| | | //fmt.Println("tmpList: ", len(tmpList)) |
| | | //logPrint("tmpList: ", len(tmpList)) |
| | | lock.Lock() |
| | | capturetable = append(capturetable, tmpList...) |
| | | lock.Unlock() |
| | |
| | | } |
| | | wg.Wait() |
| | | |
| | | fmt.Println("lenth_all: ", len(capturetable)) |
| | | fmt.Println("耗时:", time.Since(ts)) |
| | | logPrint("lenth_all: ", len(capturetable)) |
| | | logPrint("耗时:", time.Since(ts)) |
| | | return capturetable |
| | | } |
| | | |
| | |
| | | "sort":[{"picDate":{"order":"desc"}}], |
| | | "_source": {"includes":[],"excludes":["*.feature"]} |
| | | }` |
| | | fmt.Println(DSLJson) |
| | | logPrint(DSLJson) |
| | | buf, err := EsReq("POST", url, []byte(DSLJson)) |
| | | if err != nil { |
| | | return aIOceanInfo, err |
| | |
| | | } |
| | | |
| | | aIOcean := AIOceanAnalysis(sources) |
| | | //fmt.Println(len(videoperson)) |
| | | //logPrint(len(videoperson)) |
| | | return aIOcean, nil |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | aIOcean := AIOceanAnalysis(sources) |
| | | fmt.Println(len(aIOcean)) |
| | | logPrint(len(aIOcean)) |
| | | return aIOcean, nil |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | }` |
| | | //fmt.Println(DSLJson) |
| | | //logPrint(DSLJson) |
| | | buf, err := EsReq("POST", url, []byte(DSLJson)) |
| | | if err != nil { |
| | | return total, err |
| | |
| | | return total, errors.New("first hits change error!") |
| | | } |
| | | total = int(middle["total"].(float64)) |
| | | //fmt.Println(total) |
| | | //logPrint(total) |
| | | return total, nil |
| | | } |
| | | |
| | |
| | | var source = make(map[string]interface{}, 0) |
| | | tmpbuf, ok := in.(map[string]interface{}) |
| | | if !ok { |
| | | fmt.Println("change to source error!") |
| | | logPrint("change to source error!") |
| | | continue |
| | | } |
| | | sdkName := tmpbuf["key"].(string) |
| | |
| | | source["value"] = count |
| | | sources = append(sources, source) |
| | | } |
| | | //fmt.Println("tmpSource",sources) |
| | | //logPrint("tmpSource",sources) |
| | | return sources, nil |
| | | } |
| | | |
| | |
| | | var source = make(map[string]interface{}, 0) |
| | | tmpbuf, ok := in.(map[string]interface{}) |
| | | if !ok { |
| | | fmt.Println("change to source error!") |
| | | logPrint("change to source error!") |
| | | continue |
| | | } |
| | | task := tmpbuf["key"].(map[string]interface{}) |
| | |
| | | source["count"] = count |
| | | sources = append(sources, source) |
| | | } |
| | | //fmt.Println("tmpSource",sources) |
| | | //logPrint("tmpSource",sources) |
| | | return sources, nil |
| | | |
| | | } |
| | |
| | | url := "http://" + serverIp + ":" + serverPort + "/" + indexName + "/_search?preference=_shards:" + shards + "|_only_local" |
| | | var source []string |
| | | switch targetType { |
| | | case "face": |
| | | case "face", "FaceDetect": |
| | | source = []string{"id", "targetInfo.feature", "analyServerId", "cameraId"} |
| | | case "track": |
| | | source = []string{"id", "targetInfo.feature", "analyServerId", "cameraId", "targetInfo.attachTarget.feature", "targetInfo.targetLocation", "linkTagInfo.targetInfo.feature", "linkTagInfo.targetInfo.attachTarget.feature", "linkTagInfo.cameraId", "linkTagInfo.targetInfo.targetLocation"} |
| | |
| | | ` |
| | | //logger.Debug(url) |
| | | //logger.Debug(JsonDSL) |
| | | //fmt.Println(JsonDSL) |
| | | //logPrint(JsonDSL) |
| | | buf, err := EsReq("POST", url, []byte(JsonDSL)) |
| | | if err != nil { |
| | | return capdbinfo, errors.New("http request dbtablename info is err!") |
| | |
| | | if err != nil { |
| | | return capdbinfo, err |
| | | } |
| | | //fmt.Println(sources) |
| | | //logPrint(sources) |
| | | // 返回所有查询的数据 |
| | | capdbinfos := Parsesources(sources) |
| | | return capdbinfos, nil |
| | | } |
| | | |
| | | // 查询底库人员信息*缓存* |
| | | func GetOceanFeatures(serverIp string, serverPort string, queryIndexNum int, queryNums int, indexName string, shards string, targetType string) ([]*protomsg.MultiFeaCache, error) { |
| | | var dbinfos []*protomsg.MultiFeaCache |
| | | point := strconv.Itoa(queryIndexNum) |
| | | number := strconv.Itoa(queryNums) |
| | | func GetOceanFeatures(serverIp string, serverPort string, queryNums int, indexName string, shards string, targetType string) ([]*protomsg.MultiFeaCache, error) { |
| | | //queryIndexNum int |
| | | //var dbinfos []*protomsg.MultiFeaCache |
| | | dbinfos := make([]*protomsg.MultiFeaCache, 0) |
| | | //dbinfosss := make([]*protomsg.MultiFeaCache,0) |
| | | //dbinfoss = append(dbinfoss, dbinfosss...) |
| | | |
| | | JsonDSL := "" |
| | | var source []string |
| | | switch targetType { |
| | | case "face": |
| | | case "face", "FaceDetect": |
| | | source = []string{"id", "targetInfo.feature", "analyServerId"} |
| | | case "track": |
| | | source = []string{"id", "targetInfo.feature", "analyServerId", "targetInfo.attachTarget.feature", "targetInfo.targetLocation", "linkTagInfo.targetInfo.feature", "linkTagInfo.targetInfo.attachTarget.feature", "linkTagInfo.targetInfo.targetLocation"} |
| | | } |
| | | |
| | | url := "http://" + serverIp + ":" + serverPort + "/" + indexName + "/_search?preference=_shards:" + shards + "|_only_local" |
| | | JsonDSL = ` { |
| | | "from": ` + point + `, |
| | | url := "http://" + serverIp + ":" + serverPort + "/" + indexName + "/_search?preference=_shards:" + shards + "|_only_local;scroll=1m" |
| | | |
| | | var lock sync.RWMutex |
| | | var wg sync.WaitGroup |
| | | |
| | | for i := 0; i < 48; i++ { |
| | | //请求体 |
| | | JsonDSL = ` { |
| | | "slice": { |
| | | "id": "` + strconv.Itoa(i) + `", |
| | | "max": 48 |
| | | }, |
| | | "size":` + strconv.Itoa(queryNums) + `, |
| | | "query": { |
| | | "bool": { |
| | | "filter": [ |
| | |
| | | ] |
| | | } |
| | | }, |
| | | "size":` + number + `, |
| | | "_source": ["` + strings.Replace(strings.Trim(fmt.Sprint(source), "[]"), " ", "\",\"", -1) + `"] |
| | | }` |
| | | wg.Add(1) |
| | | go func(reqJsonDSL string) { |
| | | defer wg.Done() |
| | | |
| | | buf, err := EsReq("POST", url, []byte(JsonDSL)) |
| | | if err != nil { |
| | | return dbinfos, errors.New("http request dbtablename info is err!") |
| | | //fmt.Println(url) |
| | | //fmt.Println(prama) |
| | | //logPrint("url: ",url) |
| | | //logPrint("url: ",reqJsonDSL) |
| | | buf, err := EsReq("POST", url, []byte(reqJsonDSL)) |
| | | if err != nil { |
| | | logPrint("EsReq: ", err) |
| | | return |
| | | } |
| | | |
| | | // 返回 _source 数组 |
| | | sources, err := Sourcelistforscroll(buf) |
| | | if err != nil { |
| | | logPrint("EsReq: ", err) |
| | | return |
| | | } |
| | | // 返回所有查询的数据 |
| | | ftmpDatas := Parsesources(sources["sourcelist"].([]map[string]interface{})) |
| | | lock.Lock() |
| | | dbinfos = append(dbinfos, ftmpDatas...) |
| | | //logPrint("prsLen: ", len(Parsesources(sources["sourcelist"].([]map[string]interface{})))) |
| | | //logPrint("dbinfosLen: ", len(dbinfos)) |
| | | lock.Unlock() |
| | | |
| | | scroll_id := sources["scroll_id"].(string) |
| | | |
| | | //scroll请求头 |
| | | scroll_url := "http://" + serverIp + ":" + serverPort + "/_search/scroll" |
| | | for { |
| | | next_scroll_id := "" |
| | | if next_scroll_id != "" { |
| | | scroll_id = next_scroll_id |
| | | } |
| | | jsonDSL := `{ |
| | | "scroll": "1m", |
| | | "scroll_id" : "` + scroll_id + `" |
| | | }` |
| | | //fmt.Println(scroll_url) |
| | | //fmt.Println(jsonDSL) |
| | | buf, err := EsReq("POST", scroll_url, []byte(jsonDSL)) |
| | | |
| | | if err != nil { |
| | | //fmt.Println("lenth1: ", len(dbinfos)) |
| | | return |
| | | } |
| | | nextSources, err := Sourcelistforscroll(buf) |
| | | |
| | | if nextSources == nil { |
| | | return |
| | | } |
| | | |
| | | nextM := nextSources["sourcelist"].([]map[string]interface{}) |
| | | //fmt.Println("id",nextSources) |
| | | if nextM == nil || len(nextM) == 0 { |
| | | //fmt.Println("lenth: ", len(capturetable)) |
| | | return |
| | | } |
| | | tmpDatas := Parsesources(nextM) |
| | | lock.Lock() |
| | | dbinfos = append(dbinfos, tmpDatas...) |
| | | //logPrint("tmpDatasLen: ", len(tmpDatas)) |
| | | //logPrint("AdbinfosLen: ", len(dbinfos)) |
| | | lock.Unlock() |
| | | |
| | | next_scroll_id = nextSources["scroll_id"].(string) |
| | | } |
| | | |
| | | }(JsonDSL) |
| | | } |
| | | wg.Wait() |
| | | |
| | | // 返回 _source 数组 |
| | | sources, err := Sourcelist(buf) |
| | | if err != nil { |
| | | return dbinfos, err |
| | | } |
| | | fmt.Println("lenth_all: ", len(dbinfos)) |
| | | |
| | | // 返回所有查询的数据 |
| | | dbpersoninfos := Parsesources(sources) |
| | | return dbpersoninfos, nil |
| | | return dbinfos, nil |
| | | } |
| | | |
| | | //************************CORN TASK******************************* |
| | | //查询日期范围内是否还存在数据 |
| | | func QueryAnalyServerDate(serverIp string, serverPort string, indexName string, startTime string, endTime string, analyServerId string) (result bool, err error) { |
| | | func QueryAnalyServerData(serverIp string, serverPort string, indexName string, startTime string, endTime string, analyServerId string) (result bool, err error) { |
| | | url := "http://" + serverIp + ":" + serverPort + "/" + indexName + "/_search" |
| | | deleteJson := `{ |
| | | "query":{ |
| | |
| | | if err != nil { |
| | | return false, errors.New("解码失败") |
| | | } |
| | | if resTotal == -1 || resTotal == 0{ |
| | | if resTotal == -1 || resTotal == 0 { |
| | | result = false |
| | | } else { |
| | | result = true |
| | |
| | | return result, nil |
| | | } |
| | | |
| | | |
| | | //按日期范围,服务器Id删除数据 |
| | | func DeleteAnalyServerDate(serverIp string, serverPort string, indexName string, startTime string, endTime string, analyServerId string) (result bool, err error) { |
| | | func DeleteAnalyServerData(serverIp string, serverPort string, indexName string, startTime string, endTime string, analyServerId string) (result bool, err error) { |
| | | url := "http://" + serverIp + ":" + serverPort + "/" + indexName + "/_delete_by_query" |
| | | deleteJson := `{ |
| | | "query":{ |
| | |
| | | } |
| | | }, |
| | | "query": { |
| | | "match_all": {} |
| | | "bool": { |
| | | "filter": [ |
| | | { |
| | | "term": { |
| | | "application": "loopCoverage" |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }` |
| | | buf, err := EsReq("POST", url, []byte(addJson)) |