sunty
2020-08-26 34c030a58af247ceb71205bc68a886a1f55dcc0b
EsClient.go
@@ -507,7 +507,10 @@
      middleHits := topAttentionHits["hits"].(map[string]interface{})
      finalHits := middleHits["hits"].([]interface{})
      startTime := ""
      indexLength := len(finalHits)
      point := 0
      for _, in := range finalHits {
         point = point+1
         tmpHitSource := make(map[string]interface{})
         tmpbuf, ok := in.(map[string]interface{})
         if !ok {
@@ -530,7 +533,7 @@
         sTime := tmpTime
         eTime := tmpTime
         stayTime := 0.0
         if startTime != "" {
         if startTime != "" && point < indexLength{
            sinTime, _ := time.ParseInLocation("2006-01-02 15:04:05", startTime, loc)
            passTime := math.Abs(mTime.Sub(sinTime).Seconds())
            //fmt.Println("passTime:   ", passTime)
@@ -624,8 +627,11 @@
      topAttentionHits := inf.(map[string]interface{})["top_attention_hits"].(map[string]interface{})
      middleHits := topAttentionHits["hits"].(map[string]interface{})
      finalHits := middleHits["hits"].([]interface{})
      indexLength := len(finalHits)
      point := 0
      startTime := ""
      for _, in := range finalHits {
         point = point+1
         tmpHitSource := make(map[string]interface{})
         tmpbuf, ok := in.(map[string]interface{})
         if !ok {
@@ -648,7 +654,7 @@
         sTime := tmpTime
         eTime := tmpTime
         stayTime := 0.0
         if startTime != "" {
         if startTime != "" && point < indexLength{
            sinTime, _ := time.ParseInLocation("2006-01-02 15:04:05", startTime, loc)
            passTime := math.Abs(mTime.Sub(sinTime).Seconds())
            //fmt.Println("passTime:   ", passTime)