Documentation
¶
Overview ¶
Package weaviate 提供 Weaviate 向量数据库集成
Weaviate 是一个开源的向量搜索引擎,支持语义搜索和混合搜索。
特性:
- 内置向量化模块 (text2vec-openai, text2vec-cohere 等)
- 支持 BM25 关键词搜索
- 支持混合搜索 (向量 + 关键词)
- GraphQL API
- 多租户支持
使用示例:
store, err := weaviate.NewStore(ctx,
weaviate.WithHost("localhost:8080"),
weaviate.WithScheme("http"),
weaviate.WithClass("Document"),
)
defer store.Close()
Index ¶
- type Option
- type Store
- func (s *Store) Add(ctx context.Context, docs []vector.Document) error
- func (s *Store) BM25Search(ctx context.Context, query string, topK int) ([]vector.Document, error)
- func (s *Store) Clear(ctx context.Context) error
- func (s *Store) Close() error
- func (s *Store) Count(ctx context.Context) (int, error)
- func (s *Store) Delete(ctx context.Context, ids []string) error
- func (s *Store) Get(ctx context.Context, id string) (*vector.Document, error)
- func (s *Store) HybridSearch(ctx context.Context, query string, embedding []float32, topK int, ...) ([]vector.Document, error)
- func (s *Store) Search(ctx context.Context, embedding []float32, topK int, ...) ([]vector.Document, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store Weaviate 向量存储
封装 Weaviate REST API,实现 vector.Store 接口
func (*Store) BM25Search ¶
BM25Search BM25 关键词搜索
Click to show internal directories.
Click to hide internal directories.