|
@@ -14,7 +14,7 @@ import (
|
|
|
)
|
|
|
|
|
|
// SearchChartInfoData 查询es中的图表数据
|
|
|
-func SearchKnowledgeResourceByEs(resourceType int, keywordStr string, showSysIds, classifyIds []int, sourceList []string, tagIds []int, isIncludeFile bool, from, size int) (list []*knowledge.KnowledgeResource, total int64, err error) {
|
|
|
+func SearchKnowledgeResourceByEs(resourceType int, keywordStr string, showSysIds []int, myId int, classifyIds []int, sourceList []string, tagIds []int, isIncludeFile bool, from, size int) (list []*knowledge.KnowledgeResource, total int64, err error) {
|
|
|
indexName := utils.EsKnowledgeResourceIndexName
|
|
|
list = make([]*knowledge.KnowledgeResource, 0)
|
|
|
defer func() {
|
|
@@ -41,6 +41,13 @@ func SearchKnowledgeResourceByEs(resourceType int, keywordStr string, showSysIds
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
+ if myId > 0 {
|
|
|
+ mustMap = append(mustMap, map[string]interface{}{
|
|
|
+ "term": map[string]interface{}{
|
|
|
+ "AdminId": myId,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
if len(tagIds) > 0 {
|
|
|
mustMap = append(mustMap, map[string]interface{}{
|
|
|
"terms": map[string]interface{}{
|