Versions in this module Expand all Collapse all v1 v1.0.2 Dec 5, 2024 v1.0.1 Dec 5, 2024 Changes in this version + const Cosine + const Euclidean + const PointAccepted + const PointChecked + const PointIgnored + const StopSearch + func Configure(cfg Config) + func DumpIndex(filename string) + func EmbedText(texts []string, useCache bool) ([][]float64, error) + func ExportJSON(c *Collection, w io.Writer) error + func ImportJSON(collectionName string, r io.Reader) error + func RunServer() + func SpanLog(format string, v ...interface{}) + type Collection struct + func NewCollection(options CollectionOptions) (*Collection, error) + func (c *Collection) AddDocument(id uint64, vector []float64, metadata []byte) + func (c *Collection) Close() error + func (c *Collection) ComputeStats() CollectionStats + func (c *Collection) GetAllIDs() []uint64 + func (c *Collection) GetDocument(id uint64) (*Document, error) + func (c *Collection) GetDocumentCount() int + func (c *Collection) GetOptions() CollectionOptions + func (c *Collection) RemoveDocument(id uint64) error + func (c *Collection) Search(args SearchArgs) SearchResults + func (c *Collection) UpdateDocument(id uint64, newMetadata []byte) error + type CollectionOptions struct + DimensionCount int + DistanceMethod int + FileMode FileMode + Name string + Quantization int + type CollectionStats struct + AverageDistance float64 + DimensionCount int + DistanceMethod string + DocumentCount int + Quantization int + StorageSize int64 + type Config struct + DataFolder string + HTMLRoot string + ImageModel string + OllamaServer string + RandomSeed int64 + SyzgyHost string + TextModel string + type DataStream struct + Data []byte + StreamID uint8 + type Document struct + ID uint64 + Metadata []byte + Vector []float64 + type EmbedTextFunc func(text []string, useCache bool) ([][]float64, error) + type FileMode int + const CreateAndOverwrite + const CreateIfNotExists + const ReadOnly + const ReadWrite + type FilterFn func(id uint64, metadata []byte) bool + func BuildFilter(queryIn string) (FilterFn, error) + type FreeSpan struct + Length uint64 + Offset uint64 + type IndexEntry struct + Offset uint64 + SequenceNumber uint64 + Span *Span + type SearchArgs struct + Filter FilterFn + K int + Limit int + Offset int + Precision string + Radius float64 + Vector []float64 + type SearchResult struct + Distance float64 + ID uint64 + Metadata []byte + type SearchResults struct + PercentSearched float64 + Results []SearchResult + type Server struct + type Span struct + Checksum uint32 + DataStreams []DataStream + Length uint64 + MagicNumber uint32 + RecordID string + SequenceNumber uint32 + type SpanFile struct + func OpenFile(filename string, mode FileMode) (*SpanFile, error) + func (db *SpanFile) Close() error + func (db *SpanFile) GetStats() (size uint64, numRecords int) + func (db *SpanFile) IterateRecords(callback func(recordID string, sr *SpanReader) error) error + func (db *SpanFile) IterateSortedRecords(callback func(recordID string, sr *SpanReader) error) error + func (db *SpanFile) ReadRecord(recordID string) (*Span, error) + func (db *SpanFile) RemoveRecord(recordID string) error + func (db *SpanFile) WriteRecord(recordID string, dataStreams []DataStream) error + type SpanReader struct