Merge branch 'master' of http://192.168.1.14:10010/r/webserver
| | |
| | | queryStr = "\"must\":[{\"multi_match\":{\"query\":\"" + queryBody + "\",\"fields\":[\"baseInfo.sex\",\"baseInfo.phoneNum.raw^1.5\",\"baseInfo.personName.raw^1.5\",\"alarmRules.alarmLevel^1.5\",\"ageDescription^1.5\",\"taskName^1.5\",\"baseInfo.tableName^1.5\",\"sex^2.0\",\"race^2.0\",\"content^1.0\",\"baseInfo.idCard^1.8\",\"cameraAddr^1.0\"]," + |
| | | "\"type\":\"cross_fields\",\"operator\":\"OR\",\"slop\":0,\"prefix_length\":0,\"max_expansions\":50,\"zero_terms_query\":\"NONE\",\"auto_generate_synonyms_phrase_query\":true,\"fuzzy_transpositions\":true,\"boost\":1}}]," |
| | | } |
| | | gteDate := searchBody["searchTime"].([]interface{})[0].(string) |
| | | lteDate := searchBody["searchTime"].([]interface{})[1].(string) |
| | | searchTime := searchBody["searchTime"].([]interface{}) |
| | | if searchBody["searchTime"] == nil || len(searchTime) < 2 { |
| | | info := make(map[string]interface{}, 0) |
| | | info["err"] = "请输入时间范围" |
| | | return info |
| | | } |
| | | |
| | | gteDate := searchTime[0].(string) |
| | | lteDate := searchTime[1].(string) |
| | | //判断任务ID |
| | | taskIdStr := "" |
| | | taskId := searchBody["tasks"].([]interface{}) |
| | |
| | | sources := make([]map[string]interface{}, 0) |
| | | for _, value := range tokenRes["datalist"].([]interface{}) { |
| | | tokenRes := make(map[string]interface{}) |
| | | key := value.(map[string]interface{})["id"].(string) |
| | | tr := value.(map[string]interface{}) |
| | | key := tr["id"].(string) |
| | | tokenRes["key"] = key |
| | | tokenRes["title"] = value.(map[string]interface{})["tableName"].(string) |
| | | tokenRes["value"] = value.(map[string]interface{})["id"].(string) |
| | | status := int(value.(map[string]interface{})["isDelete"].(float64)) |
| | | tokenRes["title"] = tr["tableName"].(string) |
| | | tokenRes["value"] = tr["id"].(string) |
| | | status := int(tr["isDelete"].(float64)) |
| | | tokenRes["status"] = status |
| | | if status == 1 { |
| | | if GetTotalFromDb(key) == false { |
| | |
| | | func GetTotalFromDb(id string) (flag bool) { |
| | | flag = false |
| | | url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + |
| | | "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_search" |
| | | "/" + config.EsInfo.EsIndex.VideoPersons.IndexName + "/_search" |
| | | prama := "{\"query\":{\"bool\":{\"filter\":[{\"term\":{\"baseInfo.tableId\":\"" + id + "\"}}]}},\"size\":0}" |
| | | buf, err := esutil.EsReq("POST", url, []byte(prama)) |
| | | if err != nil { |
| | |
| | | fmt.Println("first hits change error!") |
| | | return |
| | | } |
| | | |
| | | total := int(middle["total"].(float64)) |
| | | if total > 0 { |
| | | flag = true |