Documentation ¶
Index ¶
- Constants
- type Collection
- type Data
- type EmbModel
- type Field
- type Index
- func (index *Index) FetchData(id interface{}, searchOptions *SearchOptions) ([]*Data, error)
- func (index *Index) Search(order interface{}, searchOptions *SearchOptions) ([]*Data, error)
- func (index *Index) SearchById(id interface{}, searchOptions *SearchOptions) ([]*Data, error)
- func (index *Index) SearchByText(text TextObject, searchOptions *SearchOptions) ([]*Data, error)
- func (index *Index) SearchByVector(vector []float64, searchOptions *SearchOptions) ([]*Data, error)
- type IndexOptions
- func (indexOptions *IndexOptions) SetCpuQuota(cpuQuota int64) *IndexOptions
- func (indexOptions *IndexOptions) SetDescription(description string) *IndexOptions
- func (indexOptions *IndexOptions) SetPartitionBy(partitionBy string) *IndexOptions
- func (indexOptions *IndexOptions) SetScalarIndex(scalarIndex []string) *IndexOptions
- func (indexOptions *IndexOptions) SetShardCount(shardCount int64) *IndexOptions
- func (indexOptions *IndexOptions) SetShardPolicy(shardPolicy string) *IndexOptions
- func (indexOptions *IndexOptions) SetVectorIndex(vectorIndex *VectorIndexParams) *IndexOptions
- type ParamOption
- type ParamOptions
- type RawData
- type ScalarOrder
- type SearchOptions
- func (searchOptions *SearchOptions) SetDenseWeight(dense_weight float64) *SearchOptions
- func (searchOptions *SearchOptions) SetFilter(filter map[string]interface{}) *SearchOptions
- func (searchOptions *SearchOptions) SetLimit(limit int64) *SearchOptions
- func (searchOptions *SearchOptions) SetOutputFields(outputFields []string) *SearchOptions
- func (searchOptions *SearchOptions) SetPartition(partition string) *SearchOptions
- func (searchOptions *SearchOptions) SetRetry(retry bool) *SearchOptions
- func (searchOptions *SearchOptions) SetSparseVectors(sparse_vectors map[string]interface{}) *SearchOptions
- type Task
- type TextObject
- type UpdateCollectionOptions
- type UpdateIndexOptions
- func (updateIndexOptions *UpdateIndexOptions) SetCpuQuota(cpuQuota int64) *UpdateIndexOptions
- func (updateIndexOptions *UpdateIndexOptions) SetDescription(description string) *UpdateIndexOptions
- func (updateIndexOptions *UpdateIndexOptions) SetScalarIndex(scalarIndex []string) *UpdateIndexOptions
- func (updateIndexOptions *UpdateIndexOptions) SetShardCount(shardCount int64) *UpdateIndexOptions
- type VectorIndexParams
- type VectorOrder
- type VikingDBService
- func (vikingDBService *VikingDBService) BatchRerank(datas []map[string]interface{}) ([]float64, error)
- func (vikingDBService *VikingDBService) CreateCollection(collectionName string, fields []Field, description string) (*Collection, error)
- func (vikingDBService *VikingDBService) CreateIndex(collectionName string, indexName string, indexOptions *IndexOptions) (*Index, error)
- func (vikingDBService *VikingDBService) CreateTask(taskType string, taskParams map[string]interface{}) (string, error)
- func (vikingDBService *VikingDBService) DoRequest(ctx context.Context, api string, query url.Values, body string) (map[string]interface{}, error)
- func (vikingDBService *VikingDBService) DropCollection(collectionName string) error
- func (vikingDBService *VikingDBService) DropIndex(collectionName string, indexName string) error
- func (vikingDBService *VikingDBService) DropTask(taskID string) error
- func (vikingDBService *VikingDBService) Embedding(embModel EmbModel, rawData interface{}) ([][]float64, error)
- func (vikingDBService *VikingDBService) EmbeddingV2(embModel EmbModel, rawData interface{}) (map[string]interface{}, error)
- func (vikingDBService *VikingDBService) GetCollection(collectionName string) (*Collection, error)
- func (vikingDBService *VikingDBService) GetIndex(collectionName string, indexName string) (*Index, error)
- func (vikingDBService *VikingDBService) GetTask(taskID string) (*Task, error)
- func (vikingDBService *VikingDBService) ListCollections() ([]*Collection, error)
- func (vikingDBService *VikingDBService) ListIndexes(collectionName string) ([]*Index, error)
- func (vikingDBService *VikingDBService) ListTasks() ([]*Task, error)
- func (vikingDBService *VikingDBService) Rerank(query string, content string, title string) (float64, error)
- func (vikingDBService *VikingDBService) SetConnectionTimeout(connectionTimeout int64)
- func (vikingDBService *VikingDBService) SetHeader(header map[string]string)
- func (vikingDBService *VikingDBService) UpdateCollection(collectionName string, updateCollectionOptions *UpdateCollectionOptions) error
- func (vikingDBService *VikingDBService) UpdateIndex(collectionName string, indexName string, ...) error
- func (vikingDBService *VikingDBService) UpdateTask(taskID string, taskStatus string) error
Constants ¶
View Source
const ( Vector = "vector" Int64 = "int64" ListInt64 = "list<int64>" String = "string" ListString = "list<string>" Float32 = "float32" Bool = "bool" Text = "text" Sparse_Vector = "sparse_vector" L2 = "l2" IP = "ip" COSINE = "cosine" FLAT = "flat" HNSW = "hnsw" IVF = "ivf" DiskANN = "DiskANN" HNSW_HYBRID = "hnsw_hybrid" Float = "float" Int8 = "int8" Fix16 = "fix16" PQ = "pq" Asc = "asc" Desc = "desc" Custom = "custom" Auto = "auto" Data_Import = "data_import" Filter_Delete = "filter_delete" MAX_RETRIES = 3 INITIAL_RETRY_DELAY = 0.5 MAX_RETRY_DELAY = 8.0 Init = "init" Queued = "queued" Running = "running" Done = "done" Fail = "fail" Confirm = "confirm" Confirmed = "confirmed" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct { CollectionName string Fields []Field VikingDBService *VikingDBService PrimaryKey string Indexes []*Index Description string Stat map[string]interface{} CreateTime string UpdateTime string UpdatePerson string }
func (*Collection) AsyncUpsertData ¶ added in v1.0.177
func (collection *Collection) AsyncUpsertData(data interface{}) error
func (*Collection) DeleteData ¶
func (collection *Collection) DeleteData(id interface{}) error
func (*Collection) FetchData ¶
func (collection *Collection) FetchData(id interface{}) ([]*Data, error)
func (*Collection) UpsertData ¶
func (collection *Collection) UpsertData(data interface{}, opts ...ParamOption) error
type Index ¶
type Index struct { CollectionName string IndexName string Description string VectorIndex *VectorIndexParams ScalarIndex interface{} Stat string VikingDBService *VikingDBService CpuQuota int64 PartitionBy string CreateTime string UpdateTime string UpdatePerson string IndexCost interface{} ShardCount int64 ShardPolicy string // contains filtered or unexported fields }
func (*Index) FetchData ¶
func (index *Index) FetchData(id interface{}, searchOptions *SearchOptions) ([]*Data, error)
func (*Index) Search ¶
func (index *Index) Search(order interface{}, searchOptions *SearchOptions) ([]*Data, error)
func (*Index) SearchById ¶
func (index *Index) SearchById(id interface{}, searchOptions *SearchOptions) ([]*Data, error)
func (*Index) SearchByText ¶
func (index *Index) SearchByText(text TextObject, searchOptions *SearchOptions) ([]*Data, error)
func (*Index) SearchByVector ¶
func (index *Index) SearchByVector(vector []float64, searchOptions *SearchOptions) ([]*Data, error)
type IndexOptions ¶
type IndexOptions struct {
// contains filtered or unexported fields
}
func NewIndexOptions ¶
func NewIndexOptions() *IndexOptions
func (*IndexOptions) SetCpuQuota ¶
func (indexOptions *IndexOptions) SetCpuQuota(cpuQuota int64) *IndexOptions
func (*IndexOptions) SetDescription ¶
func (indexOptions *IndexOptions) SetDescription(description string) *IndexOptions
func (*IndexOptions) SetPartitionBy ¶
func (indexOptions *IndexOptions) SetPartitionBy(partitionBy string) *IndexOptions
func (*IndexOptions) SetScalarIndex ¶
func (indexOptions *IndexOptions) SetScalarIndex(scalarIndex []string) *IndexOptions
func (*IndexOptions) SetShardCount ¶ added in v1.0.134
func (indexOptions *IndexOptions) SetShardCount(shardCount int64) *IndexOptions
func (*IndexOptions) SetShardPolicy ¶ added in v1.0.176
func (indexOptions *IndexOptions) SetShardPolicy(shardPolicy string) *IndexOptions
func (*IndexOptions) SetVectorIndex ¶
func (indexOptions *IndexOptions) SetVectorIndex(vectorIndex *VectorIndexParams) *IndexOptions
type ParamOption ¶ added in v1.0.181
type ParamOption func(*ParamOptions)
func WithAsyncUpsert ¶ added in v1.0.181
func WithAsyncUpsert(yes bool) ParamOption
type ParamOptions ¶ added in v1.0.181
type ParamOptions struct {
AsyncUpsert bool
}
type ScalarOrder ¶
type SearchOptions ¶
type SearchOptions struct {
// contains filtered or unexported fields
}
func NewSearchOptions ¶
func NewSearchOptions() *SearchOptions
func (*SearchOptions) SetDenseWeight ¶ added in v1.0.154
func (searchOptions *SearchOptions) SetDenseWeight(dense_weight float64) *SearchOptions
func (*SearchOptions) SetFilter ¶
func (searchOptions *SearchOptions) SetFilter(filter map[string]interface{}) *SearchOptions
func (*SearchOptions) SetLimit ¶
func (searchOptions *SearchOptions) SetLimit(limit int64) *SearchOptions
func (*SearchOptions) SetOutputFields ¶
func (searchOptions *SearchOptions) SetOutputFields(outputFields []string) *SearchOptions
func (*SearchOptions) SetPartition ¶
func (searchOptions *SearchOptions) SetPartition(partition string) *SearchOptions
func (*SearchOptions) SetRetry ¶ added in v1.0.186
func (searchOptions *SearchOptions) SetRetry(retry bool) *SearchOptions
func (*SearchOptions) SetSparseVectors ¶ added in v1.0.154
func (searchOptions *SearchOptions) SetSparseVectors(sparse_vectors map[string]interface{}) *SearchOptions
type TextObject ¶
type UpdateCollectionOptions ¶
type UpdateCollectionOptions struct {
// contains filtered or unexported fields
}
func NewUpdateCollectionOptions ¶
func NewUpdateCollectionOptions() *UpdateCollectionOptions
func (*UpdateCollectionOptions) SetDescription ¶
func (updateCollectionOptions *UpdateCollectionOptions) SetDescription(description string) *UpdateCollectionOptions
func (*UpdateCollectionOptions) SetFields ¶
func (updateCollectionOptions *UpdateCollectionOptions) SetFields(fields []Field) *UpdateCollectionOptions
type UpdateIndexOptions ¶ added in v1.0.134
type UpdateIndexOptions struct {
// contains filtered or unexported fields
}
func NewUpdateIndexOptions ¶ added in v1.0.134
func NewUpdateIndexOptions() *UpdateIndexOptions
func (*UpdateIndexOptions) SetCpuQuota ¶ added in v1.0.134
func (updateIndexOptions *UpdateIndexOptions) SetCpuQuota(cpuQuota int64) *UpdateIndexOptions
func (*UpdateIndexOptions) SetDescription ¶ added in v1.0.134
func (updateIndexOptions *UpdateIndexOptions) SetDescription(description string) *UpdateIndexOptions
func (*UpdateIndexOptions) SetScalarIndex ¶ added in v1.0.134
func (updateIndexOptions *UpdateIndexOptions) SetScalarIndex(scalarIndex []string) *UpdateIndexOptions
func (*UpdateIndexOptions) SetShardCount ¶ added in v1.0.150
func (updateIndexOptions *UpdateIndexOptions) SetShardCount(shardCount int64) *UpdateIndexOptions
type VectorIndexParams ¶
type VectorOrder ¶
type VectorOrder struct { Vector interface{} Id interface{} }
type VikingDBService ¶
func NewVikingDBService ¶
func (*VikingDBService) BatchRerank ¶ added in v1.0.146
func (vikingDBService *VikingDBService) BatchRerank(datas []map[string]interface{}) ([]float64, error)
func (*VikingDBService) CreateCollection ¶
func (vikingDBService *VikingDBService) CreateCollection(collectionName string, fields []Field, description string) (*Collection, error)
func (*VikingDBService) CreateIndex ¶
func (vikingDBService *VikingDBService) CreateIndex(collectionName string, indexName string, indexOptions *IndexOptions) (*Index, error)
func (*VikingDBService) CreateTask ¶ added in v1.0.184
func (vikingDBService *VikingDBService) CreateTask(taskType string, taskParams map[string]interface{}) (string, error)
func (*VikingDBService) DropCollection ¶
func (vikingDBService *VikingDBService) DropCollection(collectionName string) error
func (*VikingDBService) DropIndex ¶
func (vikingDBService *VikingDBService) DropIndex(collectionName string, indexName string) error
func (*VikingDBService) DropTask ¶ added in v1.0.184
func (vikingDBService *VikingDBService) DropTask(taskID string) error
func (*VikingDBService) Embedding ¶
func (vikingDBService *VikingDBService) Embedding(embModel EmbModel, rawData interface{}) ([][]float64, error)
func (*VikingDBService) EmbeddingV2 ¶ added in v1.0.154
func (vikingDBService *VikingDBService) EmbeddingV2(embModel EmbModel, rawData interface{}) (map[string]interface{}, error)
func (*VikingDBService) GetCollection ¶
func (vikingDBService *VikingDBService) GetCollection(collectionName string) (*Collection, error)
func (*VikingDBService) GetIndex ¶
func (vikingDBService *VikingDBService) GetIndex(collectionName string, indexName string) (*Index, error)
func (*VikingDBService) GetTask ¶ added in v1.0.184
func (vikingDBService *VikingDBService) GetTask(taskID string) (*Task, error)
func (*VikingDBService) ListCollections ¶
func (vikingDBService *VikingDBService) ListCollections() ([]*Collection, error)
func (*VikingDBService) ListIndexes ¶
func (vikingDBService *VikingDBService) ListIndexes(collectionName string) ([]*Index, error)
func (*VikingDBService) ListTasks ¶ added in v1.0.184
func (vikingDBService *VikingDBService) ListTasks() ([]*Task, error)
func (*VikingDBService) SetConnectionTimeout ¶ added in v1.0.150
func (vikingDBService *VikingDBService) SetConnectionTimeout(connectionTimeout int64)
func (*VikingDBService) SetHeader ¶ added in v1.0.137
func (vikingDBService *VikingDBService) SetHeader(header map[string]string)
func (*VikingDBService) UpdateCollection ¶
func (vikingDBService *VikingDBService) UpdateCollection(collectionName string, updateCollectionOptions *UpdateCollectionOptions) error
func (*VikingDBService) UpdateIndex ¶ added in v1.0.134
func (vikingDBService *VikingDBService) UpdateIndex(collectionName string, indexName string, updateIndexOptions *UpdateIndexOptions) error
func (*VikingDBService) UpdateTask ¶ added in v1.0.187
func (vikingDBService *VikingDBService) UpdateTask(taskID string, taskStatus string) error
Click to show internal directories.
Click to hide internal directories.