Skip to content

Commit

Permalink
feat: SubjectHit添加封面cover字段 (#734)
Browse files Browse the repository at this point in the history
* feat: SubjectHit添加封面cover字段

* docs: update CHANGELOG.MD
  • Loading branch information
chivehao authored Nov 12, 2024
1 parent 94db817 commit 779b23a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

- 条目条件查询索引优化 #664

## 优化

- SubjectHit添加封面cover字段

# 0.20.2

## 新特性
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public record SubjectHint(
String nameCn,
String infobox,
String summary,
String cover,
Boolean nsfw,
SubjectType type,
String airTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ private Document convert(SubjectDoc subjectDoc) {
if (StringUtils.hasText(subjectDoc.getSummary())) {
doc.add(new TextField("summary", subjectDoc.getSummary(), YES));
}
if (StringUtils.hasText(subjectDoc.getCover())) {
doc.add(new TextField("cover", subjectDoc.getCover(), YES));
}
doc.add(new StringField("nsfw", String.valueOf(subjectDoc.getNsfw()), YES));
doc.add(new StringField("type", String.valueOf(subjectDoc.getType()), YES));
doc.add(new StringField("airTime", formatTimestamp(subjectDoc.getAirTime()), YES));
Expand All @@ -215,6 +218,7 @@ private SubjectHint convert(Document doc, Highlighter highlighter) {
Long.parseLong(doc.get("id")),
doc.get("name"), doc.get("nameCn"),
doc.get("infobox"), doc.get("summary"),
doc.get("cover"),
Boolean.valueOf(doc.get("nsfw")),
SubjectType.valueOf(doc.get("type")),
doc.get("airTime")
Expand Down

0 comments on commit 779b23a

Please sign in to comment.