mirror of https://gitee.com/answerdev/answer.git
feat: add question_id to search result
This commit is contained in:
parent
7bdb6d2016
commit
1b242a182c
|
@ -5714,6 +5714,9 @@ const docTemplate = `{
|
|||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"question_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"description": "Status",
|
||||
"type": "string"
|
||||
|
|
|
@ -5702,6 +5702,9 @@
|
|||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"question_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"description": "Status",
|
||||
"type": "string"
|
||||
|
|
|
@ -1025,6 +1025,8 @@ definitions:
|
|||
type: string
|
||||
id:
|
||||
type: string
|
||||
question_id:
|
||||
type: string
|
||||
status:
|
||||
description: Status
|
||||
type: string
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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"`
|
||||
|
|
Loading…
Reference in New Issue