QdrantStorage
BaseVectorStorage for interacting with
Qdrant, a vector search engine.
The detailed information about Qdrant is available at:
Qdrant <https://qdrant.tech/>_
Parameters:
- vector_dim (int): The dimension of storing vectors.
- collection_name (Optional[str], optional): Name for the collection in the Qdrant. If not provided, set it to the current time with iso format. (default: :obj:
None) - url_and_api_key (Optional[Tuple[str, str]], optional): Tuple containing the URL and API key for connecting to a remote Qdrant instance. (default: :obj:
None) - path (Optional[str], optional): Path to a directory for initializing a local Qdrant client. (default: :obj:
None) - distance (VectorDistance, optional): The distance metric for vector comparison (default: :obj:
VectorDistance.COSINE) - delete_collection_on_del (bool, optional): Flag to determine if the collection should be deleted upon object destruction. (default: :obj:
False) **kwargs (Any): Additional keyword arguments for initializingQdrantClient.
- If
url_and_api_keyis provided, it takes priority and the client will attempt to connect to the remote Qdrant instance using the URL endpoint. - If
url_and_api_keyis not provided andpathis given, the client will use the local path to initialize Qdrant. - If neither
url_and_api_keynorpathis provided, the client will be initialized with an in-memory storage (":memory:").
init
del
del_collection is set to
:obj:True.
_create_client
_check_and_create_collection
_create_collection
- collection_name (str): Name of the collection to be created.
- size (int): Dimensionality of vectors to be stored in this collection.
- distance (VectorDistance, optional): The distance metric to be used for vector similarity. (default: :obj:
VectorDistance.COSINE) **kwargs (Any): Additional keyword arguments.
_delete_collection
- collection (str): Name of the collection to be deleted. **kwargs (Any): Additional keyword arguments.
_collection_exists
_generate_collection_name
_get_collection_info
- collection_name (str): Name of the collection to be checked.
close_client
add
- vectors (List[VectorRecord]): List of vectors to be added. **kwargs (Any): Additional keyword arguments.
update_payload
- ids (List[str]): List of unique identifiers for the vectors to be updated.
- payload (Dict[str, Any]): List of payloads to be updated. **kwargs (Any): Additional keyword arguments.
delete_collection
delete
- ids (Optional[List[str]], optional): List of unique identifiers for the vectors to be deleted.
- payload_filter (Optional[Dict[str, Any]], optional): A filter for the payload to delete points matching specific conditions. If
idsis provided,payload_filterwill be ignored unless both are combined explicitly. **kwargs (Any): Additional keyword arguments pass toQdrantClient. delete.
- If
idsis provided, the points with these IDs will be deleted directly, and thepayload_filterwill be ignored. - If
idsis not provided butpayload_filteris, then points matching thepayload_filterwill be deleted.
status
query
- query (VectorDBQuery): The query object containing the search vector and the number of top similar vectors to retrieve.
- filter_conditions (Optional[Dict[str, Any]], optional): A dictionary specifying conditions to filter the query results. **kwargs (Any): Additional keyword arguments.