package esutil import ( "errors" "strconv" "basic.com/pubsub/protomsg.git" ) func DbPersoninfos( queryindex int, querynums int ) (dbpersoninfos []protomsg.Baseinfo, err error){ point := strconv.Itoa(queryindex) number := strconv.Itoa(querynums) var dbinfoRequest = ` { "from": ` + point + `, "query": { "match_all": {} }, "size":`+ number +`, "_source": [ "tableId", "tableName", "compareScore", "personId", "personName", "personPicUrl", "phoneNum", "sex", "idCard", "monitorLevel", "faceFeature", "content", "id" ] }` // 返回请求的buf buf, err := GetDbinfo(dbinfoRequest ) if err != nil { return nil ,errors.New("http request get dbperson info is err!") } // 返回 _source 数组 sources, err := Sourcelist(buf) if err != nil { return nil,err } // 返回所有查询的数据 dbpersoninfos = Parsesources(sources) return dbpersoninfos, nil }