| | |
| | | hits := topHits["hits"].(map[string]interface{}) |
| | | hitsResult := hits["hits"].([]interface{}) |
| | | dataId := make([]string, 0) |
| | | picUrl := hitsResult[0].(map[string]interface{})["_source"].(map[string]interface{})["baseInfo"].([]interface{})[0].(map[string]interface{})["targetPicUrl"].(string) |
| | | if picUrl == ""{ |
| | | picUrl = hitsResult[0].(map[string]interface{})["_source"].(map[string]interface{})["targetInfo"].([]interface{})[0].(map[string]interface{})["picSmUrl"].(string) |
| | | } |
| | | //if hitsResult[0].(map[string]interface{})["baseInfo"] != nil { |
| | | // fmt.Println("picUrl1: ", picUrl) |
| | | // picUrl = hitsResult[0].(map[string]interface{})["baseInfo"].([]interface{})[0].(map[string]interface{})["targetPicUrl"].(string) |
| | | //} else { |
| | | // if hitsResult[0].(map[string]interface{})["targetInfo"] != nil { |
| | | // fmt.Println("picUrl2: ", picUrl) |
| | | // picUrl = hitsResult[0].(map[string]interface{})["targetInfo"].([]interface{})[0].(map[string]interface{})["picSmUrl"].(string) |
| | | // } |
| | | //} |
| | | tmpInfo["picUrl"] = picUrl |
| | | for sIndex, sourceInfo := range hitsResult { |
| | | rSourceInfo := sourceInfo.(map[string]interface{}) |
| | | source := rSourceInfo["_source"].(map[string]interface{}) |
| | |
| | | "top_hits": { |
| | | "_source": [ |
| | | "id", |
| | | "picDate" |
| | | "picDate", |
| | | "baseInfo.targetPicUrl", |
| | | "targetInfo.picSmUrl" |
| | | ], |
| | | "size": 100000, |
| | | "sort": [ |