Merge branch 'fix/search' into 'test'

Fix/search

See merge request opensource/answer!248
This commit is contained in:
杨光富 2022-11-17 06:19:41 +00:00
commit 7c7a32d91d
5 changed files with 10 additions and 0 deletions

View File

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

View File

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

View File

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

View File

@ -452,6 +452,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"`