23 lines
576 B
Go
Raw Normal View History

2024-11-15 15:05:54 +08:00
package model_es
2024-11-15 22:15:47 +08:00
// INFO @brief 这个文件就是处理 ES 存储文档特征向量的集中处理;
2024-11-15 15:05:54 +08:00
func CreateDocESFactory() *Doc {
return &Doc{}
}
type Doc struct {
2024-11-15 22:15:47 +08:00
Id int64 `json:"id"` // 对应 MySQL 中存储的文档 ID。
2024-11-15 15:05:54 +08:00
Content string `json:"content"`
Embedding []float64 `json:"embedding"`
}
func (d *Doc) IndexName() string {
return "catface_docs"
}
2024-11-15 22:15:47 +08:00
// UPDATE 因为 chunck 还是 Python 来处理会比较方便,所以 Go 这边主要还是处理查询相关的操作。
// func (d *Doc) InsertDocument() error {
// return nil
// }