瀏覽代碼

关键词匹配逻辑

xuzhiheng 5 年之前
父節點
當前提交
828dd03576
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/history/task.go

+ 5 - 3
src/history/task.go

@@ -235,7 +235,7 @@ func (c *Customer) GetData(stype string) {
 									因为要记录所有匹配上的关键词,所有优先匹配附加词,在匹配关键词
 								*/
 								//1.附加词匹配
-								IsMatch := false
+								IsMatch := true
 								// qu.Debug("sr.AW---", len(sr.AW))
 								for i, aw := range sr.AW {
 									// qu.Debug("-------------------------开始附加词匹配--------------------------")
@@ -248,9 +248,11 @@ func (c *Customer) GetData(stype string) {
 										// qu.Debug("-------------------------开始关键词匹配--------------------------")
 										IsMatchKey := RegMatch(fieldText, kw.MatchType, kw.KeyReg, matchKey, matchKeyType, true, false)
 										// qu.Debug(IsMatchKey, "------------------------------------------------------------")
-										if IsMatchKey {
-											IsMatch = true
+										if !IsMatchKey {
+											IsMatch = false
 										}
+									} else {
+										IsMatch = false
 									}
 								}
 								/*