| | |
| | | ) |
| | | |
| | | // 查询底库人员信息 |
| | | func DbPersoninfos( queryindex int, querynums int ) (dbpersoninfos []*protomsg.Baseinfo, err error){ |
| | | func DbPersoninfos( queryindex int, querynums int ) ([]*protomsg.Esinfo, error){ |
| | | var dbinfos []*protomsg.Esinfo |
| | | point := strconv.Itoa(queryindex) |
| | | number := strconv.Itoa(querynums) |
| | | |
| | |
| | | "query": { |
| | | "match_all": {} |
| | | }, |
| | | "size":`+ number +`, |
| | | "_source": [ |
| | | "size":`+ number +`, |
| | | "_source": [ |
| | | "id", |
| | | "tableId", |
| | | "tableName", |
| | | "compareScore", |
| | | "personId", |
| | | "personName", |
| | | "personPicUrl", |
| | | "phoneNum", |
| | | "sex", |
| | | "idCard", |
| | | "monitorLevel", |
| | | "faceFeature", |
| | | "content", |
| | | "id" |
| | | "faceFeature" |
| | | ] |
| | | }` |
| | | }` |
| | | |
| | | // 返回请求的buf |
| | | buf, err := GetDbinfo(dbinfoRequest ) |
| | | if err != nil { |
| | | return nil ,errors.New("http request get dbperson info is err!") |
| | | } |
| | | buf, err := EsReq("POST", "http://192.168.1.182:9200/dbtablepersons/dbpersons/_search",[]byte(dbinfoRequest)) |
| | | if err != nil { |
| | | return dbinfos ,errors.New("http request dbtablename info is err!") |
| | | } |
| | | |
| | | // 返回 _source 数组 |
| | | sources, err := Sourcelist(buf) |
| | | if err != nil { |
| | | return nil,err |
| | | return dbinfos,err |
| | | } |
| | | |
| | | // 返回所有查询的数据 |
| | | dbpersoninfos = Parsesources(sources) |
| | | dbpersoninfos := Parsesources(sources) |
| | | return dbpersoninfos, nil |
| | | } |
| | | |