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) SetVectorIndex(vectorIndex *VectorIndexParams) *IndexOptions
- type RawData
- type ScalarOrder
- type 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
- type TextObject
- type UpdateCollectionOptions
- type UpdateIndexOptions
- type VectorIndexParams
- type VectorOrder
- type VikingDBService
- 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) 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) Embedding(embModel EmbModel, rawData interface{}) ([][]float64, error)
- func (vikingDBService *VikingDBService) GetCollection(collectionName string) (*Collection, error)
- func (vikingDBService *VikingDBService) GetIndex(collectionName string, indexName string) (*Index, error)
- func (vikingDBService *VikingDBService) ListCollections() ([]*Collection, error)
- func (vikingDBService *VikingDBService) ListIndexes(collectionName string) ([]*Index, error)
- func (vikingDBService *VikingDBService) Rerank(query string, content string, title string) (float64, error)
- 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
Constants ¶
View Source
const ( Vector = "vector" Int64 = "int64" ListInt64 = "list<int64>" String = "string" ListString = "list<string>" Float32 = "float32" Bool = "bool" Text = "text" L2 = "l2" IP = "ip" COSINE = "cosine" FLAT = "flat" HNSW = "hnsw" IVF = "ivf" Float = "float" Int8 = "int8" Fix16 = "fix16" PQ = "pq" Asc = "asc" Desc = "desc" )
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) 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{}) 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 // 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) SetVectorIndex ¶
func (indexOptions *IndexOptions) SetVectorIndex(vectorIndex *VectorIndexParams) *IndexOptions
type ScalarOrder ¶
type SearchOptions ¶
type SearchOptions struct {
// contains filtered or unexported fields
}
func NewSearchOptions ¶
func NewSearchOptions() *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
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
type VectorIndexParams ¶
type VectorOrder ¶
type VectorOrder struct { Vector interface{} Id interface{} }
type VikingDBService ¶
func NewVikingDBService ¶
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) DropCollection ¶
func (vikingDBService *VikingDBService) DropCollection(collectionName string) error
func (*VikingDBService) DropIndex ¶
func (vikingDBService *VikingDBService) DropIndex(collectionName string, indexName string) error
func (*VikingDBService) Embedding ¶
func (vikingDBService *VikingDBService) Embedding(embModel EmbModel, rawData interface{}) ([][]float64, 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) ListCollections ¶
func (vikingDBService *VikingDBService) ListCollections() ([]*Collection, error)
func (*VikingDBService) ListIndexes ¶
func (vikingDBService *VikingDBService) ListIndexes(collectionName string) ([]*Index, error)
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
Click to show internal directories.
Click to hide internal directories.