xuzhiheng 2 years ago
parent
commit
698dd96344
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/util/utiltag.go

+ 9 - 1
src/util/utiltag.go

@@ -893,7 +893,15 @@ func Utiltags(tag map[string]interface{}) string {
 		if QueryObjecct.Bool == nil {
 			QueryObjecct.Bool = &fqBoolObject
 		} else {
-			QueryObjecct.Bool.Must = append(QueryObjecct.Bool.Must, &fqBoolObject)
+			if fqBoolObject.Must != nil {
+				QueryObjecct.Bool.Must = append(QueryObjecct.Bool.Must, fqBoolObject.Must...)
+			}
+			if fqBoolObject.Should != nil {
+				QueryObjecct.Bool.Should = append(QueryObjecct.Bool.Should, fqBoolObject.Should...)
+			}
+			if fqBoolObject.MustNot != nil {
+				QueryObjecct.Bool.MustNot = append(QueryObjecct.Bool.MustNot, fqBoolObject.MustNot...)
+			}
 		}
 		if len(torules.Should) > 0 {
 			QueryObjecct.Bool.Must = append(QueryObjecct.Bool.Must, map[string]interface{}{