Documentation
¶
Index ¶
- func CreateCollectionIfNotExists(ctx context.Context, client *qdrant.Client, collectionName string, ...) error
- func DbFiltersAsQdrant(dbFilters sharedtypes.DbFilters) *qdrant.Filter
- func QdrantClient() (*qdrant.Client, error)
- func QdrantPayloadToMap(payload map[string]*qdrant.Value) map[string]any
- func QdrantPayloadToType[T any](payload map[string]*qdrant.Value) (T, error)
- func RetrieveChildNodes(ctx *logging.ContextMap, client *qdrant.Client, collectionName string, ...) (funcError error)
- func RetrieveDirectSiblingNodes(ctx *logging.ContextMap, client *qdrant.Client, collectionName string, ...) (funcError error)
- func RetrieveLeafNodes(ctx *logging.ContextMap, client *qdrant.Client, collectionName string, ...) (funcError error)
- func RetrieveParentNodes(ctx *logging.ContextMap, client *qdrant.Client, collectionName string, ...) (funcError error)
- func ToQdrantPayload[T any](t T) (map[string]*qdrant.Value, error)
- func VectorDistance(distance string) qdrant.Distance
- type AsQdrantFilterConditions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCollectionIfNotExists ¶
func CreateCollectionIfNotExists(ctx context.Context, client *qdrant.Client, collectionName string, vectorsConfig *qdrant.VectorsConfig, sparseVectorsConfig *qdrant.SparseVectorConfig) error
func DbFiltersAsQdrant ¶
func DbFiltersAsQdrant(dbFilters sharedtypes.DbFilters) *qdrant.Filter
Transform `sharedtypes.DbFilters` into a qdrant filter.
func QdrantClient ¶
Create a new qdrant client from your config.
func QdrantPayloadToType ¶
func RetrieveChildNodes ¶
func RetrieveChildNodes(ctx *logging.ContextMap, client *qdrant.Client, collectionName string, data *[]sharedtypes.DbResponse) (funcError error)
RetrieveChildNodes retrieves the child nodes for each of the documents provided.
Parameters:
- ctx: ContextMap.
- client: the qdrant client
- collectionName: Name of the collection in the qdrant database to retrieve the children from.
- data: Data to retrieve the children for.
Returns:
- error: Error if any issue occurs while retrieving the children.
func RetrieveDirectSiblingNodes ¶
func RetrieveDirectSiblingNodes(ctx *logging.ContextMap, client *qdrant.Client, collectionName string, data *[]sharedtypes.DbResponse) (funcError error)
RetrieveDirectSiblingNodes retrieves the nodes associated with the next & previous sibling (if any) for each of the documents provided.
Parameters:
- ctx: ContextMap.
- client: the qdrant client
- collectionName: Name of the collection in the qdrant database to retrieve the siblings from.
- data: Data to retrieve the siblings for.
Returns:
- error: Error if any issue occurs while retrieving the siblings.
func RetrieveLeafNodes ¶
func RetrieveLeafNodes(ctx *logging.ContextMap, client *qdrant.Client, collectionName string, data *[]sharedtypes.DbResponse) (funcError error)
RetrieveLeafNodes retrieves all leaf nodes from the similarity search result branch (ultimate children containing the original document).
Parameters:
- ctx: ContextMap.
- client: the qdrant client
- collectionName: Name of the collection in the qdrant database to retrieve the leaves from.
- data: Data to retrieve the leaf nodes for.
Returns:
- error: Error if any issue occurs while retrieving the leaves.
func RetrieveParentNodes ¶
func RetrieveParentNodes(ctx *logging.ContextMap, client *qdrant.Client, collectionName string, data *[]sharedtypes.DbResponse) (funcError error)
RetrieveParentNodes retrieves the parent node for each of the documents provided.
Parameters:
- ctx: ContextMap.
- client: the qdrant client
- collectionName: Name of the collection in the qdrant database to retrieve the parents from.
- data: Data to retrieve the parent nodes for.
Returns:
- error: Error if any issue occurs while retrieving the parents.
func VectorDistance ¶
Get a qdrant vector distance metric from string
Available options are:
- cosine
- dot
- euclid
- manhattan