Browse Source

fix:文章加入到es

Roc 2 weeks ago
parent
commit
cbdeda4dbf

+ 1 - 1
controllers/llm/wechat_platform.go

@@ -751,7 +751,7 @@ func (c *WechatPlatformController) ArticleDel() {
 //	// 微信文章加到es
 //	{
 //		obj := rag.WechatArticle{}
-//		list, _ := obj.GetListByCondition(` wechat_article_id `, ` `, []interface{}{}, 0, 1000)
+//		list, _ := obj.GetListByCondition(` wechat_article_id `, ` `, []interface{}{}, 0, 10000)
 //		total := len(list)
 //		for k, item := range list {
 //			fmt.Println(k, "/", total)

+ 2 - 2
services/elastic/wechat_article.go

@@ -148,7 +148,7 @@ func WechatArticleEsDel(docId string) (err error) {
 }
 
 func WechatArticleEsSearch(keywordStr string, wechatPlatformId, from, size int, sortMap map[string]string) (total int64, list []*WechatArticleAndPlatform, err error) {
-	indexName := utils.DATA_INDEX_NAME
+	indexName := utils.EsWechatArticleName
 	list = make([]*WechatArticleAndPlatform, 0)
 	defer func() {
 		if err != nil {
@@ -158,7 +158,7 @@ func WechatArticleEsSearch(keywordStr string, wechatPlatformId, from, size int,
 
 	query := elastic.NewBoolQuery()
 
-	if wechatPlatformId >= 0 {
+	if wechatPlatformId > 0 {
 		query = query.Must(elastic.NewTermQuery("WechatPlatformId", wechatPlatformId))
 	}
 

+ 2 - 2
services/wechat_platform.go

@@ -878,8 +878,8 @@ func AddOrEditEsWechatArticle(articleId int) {
 		Link:             articleInfo.Link,
 		CoverUrl:         articleInfo.CoverUrl,
 		Description:      articleInfo.Description,
-		Content:          articleInfo.Content,
-		TextContent:      articleInfo.TextContent,
+		//Content:          articleInfo.Content,
+		//TextContent: articleInfo.TextContent,
 		//AbstractStatus:          articleInfo.AbstractStatus,
 		Country:           articleInfo.Country,
 		Province:          articleInfo.Province,