feat: add question_id to search result

This commit is contained in:
kumfo 2022-11-17 14:14:02 +08:00
parent 7bdb6d2016
commit 1b242a182c
5 changed files with 10 additions and 0 deletions

View File

@ -5714,6 +5714,9 @@ const docTemplate = `{
"id": {
"type": "string"
},
"question_id": {
"type": "string"
},
"status": {
"description": "Status",
"type": "string"

View File

@ -5702,6 +5702,9 @@
"id": {
"type": "string"
},
"question_id": {
"type": "string"
},
"status": {
"description": "Status",
"type": "string"

View File

@ -1025,6 +1025,8 @@ definitions:
type: string
id:
type: string
question_id:
type: string
status:
description: Status
type: string

View File

@ -450,6 +450,7 @@ func (sr *searchRepo) parseResult(ctx context.Context, res []map[string][]byte)
object = schema.SearchObject{
ID: string(r["id"]),
QuestionID: string(r["question_id"]),
Title: string(r["title"]),
Excerpt: htmltext.FetchExcerpt(string(r["parsed_text"]), "...", 240),
CreatedAtParsed: tp.Unix(),

View File

@ -10,6 +10,7 @@ type SearchDTO struct {
type SearchObject struct {
ID string `json:"id"`
QuestionID string `json:"question_id"`
Title string `json:"title"`
Excerpt string `json:"excerpt"`
CreatedAtParsed int64 `json:"created_at"`