chore: tags use array

This commit is contained in:
deepzz0
2021-04-28 12:50:06 +08:00
parent 9f563f0ae9
commit beea4f1746
6 changed files with 25 additions and 23 deletions

View File

@@ -111,13 +111,12 @@ func ElasticAddIndex(article *model.Article) error {
return err
}
tags := strings.Split(article.Tags, ",")
img := tools.PickFirstImage(article.Content)
mapping := map[string]interface{}{
"title": article.Title,
"content": tools.IgnoreHtmlTag(article.Content),
"slug": article.Slug,
"tag": tags,
"tag": article.Tags,
"img": img,
"date": article.CreatedAt,
}