NewMemoryStore 创建内存向量存储。
()
| 17 | |
| 18 | // NewMemoryStore 创建内存向量存储。 |
| 19 | func NewMemoryStore() *MemoryStore { |
| 20 | return &MemoryStore{ |
| 21 | docs: make(map[string]Document), |
| 22 | index: make(map[string][]string), |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | // Upsert 将文档插入或更新到内存存储。 |
| 27 | func (s *MemoryStore) Upsert(_ context.Context, docs []Document) error { |
no outgoing calls