xuzhiheng 4 年之前
父节点
当前提交
5e8f739baa
共有 1 个文件被更改,包括 12 次插入7 次删除
  1. 12 7
      src/util/utiltag.go

+ 12 - 7
src/util/utiltag.go

@@ -667,21 +667,26 @@ func method2(newEsObject sql.NewEsObject, keyword, keymatch string, tmps []strin
 	}
 	log.Println("+++++++", tmps, keymatch)
 	if len(tmps) == 1 && (strings.Contains(keymatch, "6") || strings.Contains(keymatch, "7")) {
-		notkeyline := []interface{}{}
+		var notkeyline interface{}
 		if tmps[0] == "buyer" {
-			notkeyline = append(notkeyline, sql.BuyerMatch{
+			// notkeyline = append(notkeyline, sql.BuyerMatch{
+			// 	Buyer: &sql.Buyer{Buyer: notKeyWordArr},
+			// })
+			notkeyline = sql.BuyerMatch{
 				Buyer: &sql.Buyer{Buyer: notKeyWordArr},
-			})
-
+			}
 			//toptypeSubtype := sql.ToptypeSubtype{}
 			//toptypeSubtype.Toptype = strings.Split(tab.Stoptype, ",")
 			//ffBoolObject.Must = append(ffBoolObject.Must, sql.ToptypeSubtypeMust{&toptypeSubtype})
 		} else if tmps[0] == "s_winner" {
-			notkeyline = append(notkeyline, sql.WinnerMatch{
+			// notkeyline = append(notkeyline, sql.WinnerMatch{
+			// 	Winner: &sql.Winner{Winner: notKeyWordArr},
+			// })
+			notkeyline = sql.WinnerMatch{
 				Winner: &sql.Winner{Winner: notKeyWordArr},
-			})
+			}
 		}
-		if len(notkeyline) > 0 {
+		if notkeyline != nil {
 			newEsObject.Bool.MustNot = append(newEsObject.Bool.MustNot, notkeyline)
 		}
 	}