Browse Source

no message

xingzai 2 years ago
parent
commit
26647f7c93
1 changed files with 4 additions and 0 deletions
  1. 4 0
      services/elastic.go

+ 4 - 0
services/elastic.go

@@ -250,6 +250,10 @@ func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string
 		keyWordArr = append(keyWordArr, keyWord)
 		keyWordLen = len(keyWordArr)
 	}
+	//如果没有联想词,而且查询的还是联想词就返回
+	if ikType == 2 && keyWordLen == 1 {
+		return
+	}
 	//Es 的高级查询有 自定义排序 文档一时半会儿撸不懂,先做多次查询手动过滤 2023.2.2
 	//ikType 查询方式 ,0:查所有 、 1:查询键入词 、 2:查询除了查询键入词之外的联想词
 	mustMap := make([]interface{}, 0)