Documentation
¶
Index ¶
- Constants
- Variables
- func DeepCopyMetadata(metadata types.Meta) types.Meta
- func GetDefaultOptions() *option.Options
- type AddDataCallback
- type Data
- type Embedder
- type Index
- func (i *Index) Add(ctx context.Context, data *Data) error
- func (i *Index) Drop(ctx context.Context) error
- func (i *Index) Embedder() Embedder
- func (i *Index) IsEmpty(ctx context.Context) (bool, error)
- func (i *Index) LoadFromDocuments(ctx context.Context, documents []document.Document) error
- func (i *Index) Query(ctx context.Context, query string, opts ...option.Option) (SearchResults, error)
- func (i *Index) Search(ctx context.Context, values []float64, opts ...option.Option) (SearchResults, error)
- func (i *Index) WithAddDataCallback(callback AddDataCallback) *Index
- func (i *Index) WithBatchInsertSize(batchInsertSize int) *Index
- func (i *Index) WithIncludeContents(includeContents bool) *Index
- type SearchResult
- type SearchResults
- type VectorDB
Constants ¶
View Source
const ( DefaultKeyID = "id" DefaultKeyContent = "content" )
Variables ¶
View Source
var (
ErrInternal = errors.New("internal index error")
)
Functions ¶
func GetDefaultOptions ¶ added in v0.0.12
Types ¶
type AddDataCallback ¶ added in v0.0.12
type Index ¶ added in v0.0.12
type Index struct {
// contains filtered or unexported fields
}
func (*Index) LoadFromDocuments ¶ added in v0.0.12
func (*Index) WithAddDataCallback ¶ added in v0.0.12
func (i *Index) WithAddDataCallback(callback AddDataCallback) *Index
WithAddDataCallback allows to modify the data before it is added to the index. This can be useful to add additional metadata to the vector.
func (*Index) WithBatchInsertSize ¶ added in v0.0.12
func (*Index) WithIncludeContents ¶ added in v0.0.12
type SearchResult ¶ added in v0.0.11
func (*SearchResult) Content ¶ added in v0.0.11
func (s *SearchResult) Content() string
type SearchResults ¶ added in v0.0.11
type SearchResults []SearchResult
func (SearchResults) ToDocuments ¶ added in v0.0.11
func (s SearchResults) ToDocuments() []document.Document
Click to show internal directories.
Click to hide internal directories.