mirror of https://gitee.com/answerdev/answer.git
Merge branch 'fix/search' into 'test'
Fix/search See merge request opensource/answer!248
This commit is contained in:
commit
7c7a32d91d
|
@ -5800,6 +5800,9 @@ const docTemplate = `{
|
|||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"question_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"description": "Status",
|
||||
"type": "string"
|
||||
|
|
|
@ -5788,6 +5788,9 @@
|
|||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"question_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"description": "Status",
|
||||
"type": "string"
|
||||
|
|
|
@ -1052,6 +1052,8 @@ definitions:
|
|||
type: string
|
||||
id:
|
||||
type: string
|
||||
question_id:
|
||||
type: string
|
||||
status:
|
||||
description: Status
|
||||
type: string
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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