mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
218 lines
13 KiB
HTML
218 lines
13 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module Client</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
</head><body bgcolor="#f0f0f8">
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
|
<tr bgcolor="#7799ee">
|
|
<td valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>Client</strong></big></big></font></td
|
|
><td align=right valign=bottom
|
|
><font color="#ffffff" face="helvetica, arial"><a href="../..">index</a><br><a href="file:/home/yangxuan/vecwise_engine/python/sdk/client/Client.py">/home/yangxuan/vecwise_engine/python/sdk/client/Client.py</a></font></td></tr></table>
|
|
<p></p>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#aa55cc">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="milvus.thrift.MilvusService.html">milvus.thrift.MilvusService</a><br>
|
|
<a href="thrift.protocol.TBinaryProtocol.html">thrift.protocol.TBinaryProtocol</a><br>
|
|
</td><td width="25%" valign=top><a href="thrift.transport.TSocket.html">thrift.transport.TSocket</a><br>
|
|
<a href="thrift.transport.TTransport.html">thrift.transport.TTransport</a><br>
|
|
</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
|
|
<a href="milvus.thrift.ttypes.html">milvus.thrift.ttypes</a><br>
|
|
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ee77aa">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
|
<td width="100%"><dl>
|
|
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="client.Client.html#Prepare">Prepare</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
<dt><font face="helvetica, arial"><a href="client.Abstract.html#ConnectIntf">client.Abstract.ConnectIntf</a>(<a href="builtins.html#object">builtins.object</a>)
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="client.Client.html#Milvus">Milvus</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
</dl>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="Milvus">class <strong>Milvus</strong></a>(<a href="client.Abstract.html#ConnectIntf">client.Abstract.ConnectIntf</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>SDK client abstract class<br>
|
|
<br>
|
|
Connection is a abstract class<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="client.Client.html#Milvus">Milvus</a></dd>
|
|
<dd><a href="client.Abstract.html#ConnectIntf">client.Abstract.ConnectIntf</a></dd>
|
|
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods defined here:<br>
|
|
<dl><dt><a name="Milvus-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return repr(self).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-add_vectors"><strong>add_vectors</strong></a>(self, table_name, records)</dt><dd><tt>Add vectors to table<br>
|
|
<br>
|
|
:param table_name: table name been inserted<br>
|
|
:param records: List[RowRecord], list of vectors been inserted<br>
|
|
<br>
|
|
`Please use <a href="#Prepare">Prepare</a>.row_record generate records`<br>
|
|
<br>
|
|
:returns:<br>
|
|
Status : indicate if vectors inserted successfully<br>
|
|
ids :list of id, after inserted every vector is given a id</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-client_version"><strong>client_version</strong></a>(self)</dt><dd><tt>Provide client version<br>
|
|
<br>
|
|
:return: Client version</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-connect"><strong>connect</strong></a>(self, host='localhost', port='9090', uri=None)</dt><dd><tt>Connect method should be called before any operations<br>
|
|
Server will be connected after connect return OK<br>
|
|
Should be implemented<br>
|
|
<br>
|
|
:type host: str<br>
|
|
:param host: host<br>
|
|
<br>
|
|
:type port: str<br>
|
|
:param port: port<br>
|
|
<br>
|
|
:type uri: str<br>
|
|
:param uri: (Optional) uri<br>
|
|
<br>
|
|
:return Status, indicate if connect is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-create_table"><strong>create_table</strong></a>(self, param)</dt><dd><tt>Create table<br>
|
|
<br>
|
|
:param param: Provide table information to be created,<br>
|
|
<br>
|
|
`Please use <a href="#Prepare">Prepare</a>.table_schema generate param`<br>
|
|
<br>
|
|
:return: Status, indicate if operation is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-delete_table"><strong>delete_table</strong></a>(self, table_name)</dt><dd><tt>Delete table<br>
|
|
<br>
|
|
:param table_name: Name of the table being deleted<br>
|
|
<br>
|
|
:return: Status, indicate if operation is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-describe_table"><strong>describe_table</strong></a>(self, table_name)</dt><dd><tt>Show table information<br>
|
|
<br>
|
|
:param table_name: str, which table to be shown<br>
|
|
<br>
|
|
:returns:<br>
|
|
Status: indicate if query is successful<br>
|
|
table_schema: TableSchema, return when operation is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-disconnect"><strong>disconnect</strong></a>(self)</dt><dd><tt>Disconnect, server will be disconnected after disconnect return SUCCESS<br>
|
|
Should be implemented<br>
|
|
<br>
|
|
:return Status, indicate if connect is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-get_table_row_count"><strong>get_table_row_count</strong></a>(self, table_name)</dt><dd><tt>Get table row count<br>
|
|
<br>
|
|
:type table_name, str<br>
|
|
:param table_name, target table name.<br>
|
|
<br>
|
|
:returns:<br>
|
|
Status: indicate if operation is successful<br>
|
|
res: int, table row count</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-search_vectors"><strong>search_vectors</strong></a>(self, table_name, top_k, query_records, query_ranges=None)</dt><dd><tt>Query vectors in a table<br>
|
|
<br>
|
|
:param table_name: str, table name been queried<br>
|
|
:param query_records: list[QueryRecord], all vectors going to be queried<br>
|
|
<br>
|
|
`Please use <a href="#Prepare">Prepare</a>.query_record generate QueryRecord`<br>
|
|
<br>
|
|
:param top_k: int, how many similar vectors will be searched<br>
|
|
:param query_ranges, (Optional) list[Range], search range<br>
|
|
<br>
|
|
:returns:<br>
|
|
Status: indicate if query is successful<br>
|
|
res: list[TopKQueryResult], return when operation is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-server_status"><strong>server_status</strong></a>(self, cmd=None)</dt><dd><tt>Provide server status<br>
|
|
<br>
|
|
:return: Server status</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-server_version"><strong>server_version</strong></a>(self)</dt><dd><tt>Provide server version<br>
|
|
<br>
|
|
:return: Server version</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Milvus-show_tables"><strong>show_tables</strong></a>(self)</dt><dd><tt>Show all tables in database<br>
|
|
<br>
|
|
:return:<br>
|
|
Status: indicate if this operation is successful<br>
|
|
tables: list[str], list of table names, return when operation<br>
|
|
is successful</tt></dd></dl>
|
|
|
|
<hr>
|
|
Data descriptors defined here:<br>
|
|
<dl><dt><strong>connected</strong></dt>
|
|
</dl>
|
|
<hr>
|
|
Data descriptors inherited from <a href="client.Abstract.html#ConnectIntf">client.Abstract.ConnectIntf</a>:<br>
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
</dl>
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
</dl>
|
|
</td></tr></table> <p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="Prepare">class <strong>Prepare</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
|
|
|
|
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
|
<td width="100%">Class methods defined here:<br>
|
|
<dl><dt><a name="Prepare-range"><strong>range</strong></a>(start, end)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>:param start: str, (Required) range start<br>
|
|
:param end: str (Required) range end<br>
|
|
<br>
|
|
:return Range</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Prepare-row_record"><strong>row_record</strong></a>(vector_data)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Record inserted<br>
|
|
<br>
|
|
:param vector_data: float binary str, (Required) a binary str</tt></dd></dl>
|
|
|
|
<dl><dt><a name="Prepare-table_schema"><strong>table_schema</strong></a>(table_name, dimension, index_type=<IndexType.INVALIDE: 0>, store_raw_vector=False)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>:param table_name: str, (Required) name of table<br>
|
|
:param index_type: IndexType, (Required) index type, default = IndexType.INVALID<br>
|
|
:param dimension: int64, (Optional) dimension of the table<br>
|
|
:param store_raw_vector: bool, (Optional) default = False<br>
|
|
<br>
|
|
:return: TableSchema</tt></dd></dl>
|
|
|
|
<hr>
|
|
Data descriptors defined here:<br>
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
</dl>
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
</dl>
|
|
</td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#55aa55">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
|
<td width="100%"><strong>LOGGER</strong> = <Logger Client (WARNING)><br>
|
|
<strong>__NAME__</strong> = 'Thrift_Client'<br>
|
|
<strong>__VERSION__</strong> = '0.0.1'</td></tr></table>
|
|
</body></html> |