diff --git a/app/model_res/doc.go b/app/model_res/doc.go index 565b0a1..00845f9 100644 --- a/app/model_res/doc.go +++ b/app/model_res/doc.go @@ -3,21 +3,24 @@ package model_res import ( "catface/app/model" "catface/app/model_es" + "time" ) // BUG 存在 依賴循環 func NewDocResult(doc *model.Doc, doc_es *model_es.Doc) *DocResult { return &DocResult{ - Type: "doc", - Id: doc.Id, - Name: doc.Name, - Content: doc_es.Content, + Type: "doc", + Id: doc.Id, + Name: doc.Name, + Content: doc_es.Content, + UpdatedAt: doc.UpdatedAt, } } type DocResult struct { - Type string `json:"type"` - Id int64 `json:"id"` - Name string `json:"name"` - Content string `json:"content"` + Type string `json:"type"` + Id int64 `json:"id"` + Name string `json:"name"` + Content string `json:"content"` + UpdatedAt *time.Time `json:"updated_at"` } diff --git a/app/service/rag/curd/doc_curd.go b/app/service/rag/curd/doc_curd.go index 1c3be36..b9a6bce 100644 --- a/app/service/rag/curd/doc_curd.go +++ b/app/service/rag/curd/doc_curd.go @@ -29,7 +29,7 @@ func (d *DocCurd) TopK(embedding []float64, k int) (temp []model_res.DocResult, for _, doc := range docs_es { ids = append(ids, doc.Id) } - docs := d.doc.ShowByIds(ids, "id", "name") + docs := d.doc.ShowByIds(ids, "id", "name", "updated_at") // 装载 for _, doc := range docs { diff --git a/config/config.yml b/config/config.yml index 2455305..c8fd995 100644 --- a/config/config.yml +++ b/config/config.yml @@ -173,7 +173,7 @@ QiNiu: SecretKey: "UP5-GmSmAYNbMlSb6LYLuKZ-fT35nlEzGvOKKm9S" ElasticSearch: - Start: 0 # 0 不启动;1 启动 + Start: 1 # 0 不启动;1 启动 Addr: "http://localhost:9200" UserName: "elastic" Password: ""