TairVectorStore#

class llama_index.vector_stores.TairVectorStore(tair_url: str, index_name: str, index_type: str = 'HNSW', index_args: Optional[Dict[str, Any]] = None, overwrite: bool = False, **kwargs: Any)#

Bases: VectorStore

Attributes Summary

client

Return the Tair client instance.

flat_metadata

stores_node

stores_text

Methods Summary

add(nodes, **add_kwargs)

Add nodes to the index.

delete(ref_doc_id, **delete_kwargs)

Delete a document.

delete_index()

Delete the index and all documents.

query(query, **kwargs)

Query the index.

Attributes Documentation

client#

Return the Tair client instance.

flat_metadata = False#
stores_node = True#
stores_text: bool = True#

Methods Documentation

add(nodes: List[BaseNode], **add_kwargs: Any) List[str]#

Add nodes to the index.

Parameters

nodes (List[BaseNode]) – List of nodes with embeddings

Returns

List of ids of the documents added to the index.

Return type

List[str]

delete(ref_doc_id: str, **delete_kwargs: Any) None#

Delete a document.

Parameters

doc_id (str) – document id

delete_index() None#

Delete the index and all documents.

query(query: VectorStoreQuery, **kwargs: Any) VectorStoreQueryResult#

Query the index.

Parameters

query (VectorStoreQuery) – query object

Returns

query result

Return type

VectorStoreQueryResult

Raises

ValueError – If query.query_embedding is None.