mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
353 lines
18 KiB
HTML
353 lines
18 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module Abstract</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>Abstract</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/Abstract.py">/home/yangxuan/vecwise_engine/python/sdk/client/Abstract.py</a></font></td></tr></table>
|
|
<p></p>
|
|
<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.Abstract.html#ConnectIntf">ConnectIntf</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="client.Abstract.html#QueryResult">QueryResult</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="client.Abstract.html#Range">Range</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="client.Abstract.html#RowRecord">RowRecord</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="client.Abstract.html#TableSchema">TableSchema</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="client.Abstract.html#TopKQueryResult">TopKQueryResult</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
<dt><font face="helvetica, arial"><a href="enum.html#IntEnum">enum.IntEnum</a>(<a href="builtins.html#int">builtins.int</a>, <a href="enum.html#Enum">enum.Enum</a>)
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="client.Abstract.html#IndexType">IndexType</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="ConnectIntf">class <strong>ConnectIntf</strong></a>(<a href="builtins.html#object">builtins.object</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%">Methods defined here:<br>
|
|
<dl><dt><a name="ConnectIntf-add_vectors"><strong>add_vectors</strong></a>(self, table_name, records)</dt><dd><tt>Add vectors to table<br>
|
|
Should be implemented<br>
|
|
<br>
|
|
:type table_name: str<br>
|
|
:param table_name: table name been inserted<br>
|
|
<br>
|
|
:type records: list[<a href="#RowRecord">RowRecord</a>]<br>
|
|
:param records: list of vectors been inserted<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="ConnectIntf-client_version"><strong>client_version</strong></a>(self)</dt><dd><tt>Provide client version<br>
|
|
should be implemented<br>
|
|
<br>
|
|
:return: str, client version</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ConnectIntf-connect"><strong>connect</strong></a>(self, host=None, port=None, 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="ConnectIntf-connected"><strong>connected</strong></a>(self)</dt><dd><tt>connected, connection status<br>
|
|
Should be implemented<br>
|
|
<br>
|
|
:return Status, indicate if connect is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ConnectIntf-create_table"><strong>create_table</strong></a>(self, param)</dt><dd><tt>Create table<br>
|
|
Should be implemented<br>
|
|
<br>
|
|
:type param: <a href="#TableSchema">TableSchema</a><br>
|
|
:param param: provide table information to be created<br>
|
|
<br>
|
|
:return Status, indicate if connect is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ConnectIntf-delete_table"><strong>delete_table</strong></a>(self, table_name)</dt><dd><tt>Delete table<br>
|
|
Should be implemented<br>
|
|
<br>
|
|
:type table_name: str<br>
|
|
:param table_name: table_name of the deleting table<br>
|
|
<br>
|
|
:return Status, indicate if connect is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ConnectIntf-describe_table"><strong>describe_table</strong></a>(self, table_name)</dt><dd><tt>Show table information<br>
|
|
Should be implemented<br>
|
|
<br>
|
|
:type table_name: str<br>
|
|
:param table_name: which table to be shown<br>
|
|
<br>
|
|
:returns<br>
|
|
Status: indicate if query is successful<br>
|
|
table_schema: <a href="#TableSchema">TableSchema</a>, given when operation is successful</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ConnectIntf-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="ConnectIntf-get_table_row_count"><strong>get_table_row_count</strong></a>(self, table_name)</dt><dd><tt>Get table row count<br>
|
|
Should be implemented<br>
|
|
<br>
|
|
:type table_name, str<br>
|
|
:param table_name, target table name.<br>
|
|
<br>
|
|
:returns<br>
|
|
Status: indicate if operation is successful<br>
|
|
count: int, table row count</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ConnectIntf-search_vectors"><strong>search_vectors</strong></a>(self, table_name, query_records, query_ranges, top_k)</dt><dd><tt>Query vectors in a table<br>
|
|
Should be implemented<br>
|
|
<br>
|
|
:type table_name: str<br>
|
|
:param table_name: table name been queried<br>
|
|
<br>
|
|
:type query_records: list[<a href="#RowRecord">RowRecord</a>]<br>
|
|
:param query_records: all vectors going to be queried<br>
|
|
<br>
|
|
:type query_ranges: list[<a href="#Range">Range</a>]<br>
|
|
:param query_ranges: Optional ranges for conditional search.<br>
|
|
If not specified, search whole table<br>
|
|
<br>
|
|
:type top_k: int<br>
|
|
:param top_k: how many similar vectors will be searched<br>
|
|
<br>
|
|
:returns<br>
|
|
Status: indicate if query is successful<br>
|
|
query_results: list[<a href="#TopKQueryResult">TopKQueryResult</a>]</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ConnectIntf-server_status"><strong>server_status</strong></a>(self, cmd)</dt><dd><tt>Provide server status<br>
|
|
should be implemented<br>
|
|
:type cmd, str<br>
|
|
<br>
|
|
:return: str, server status</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ConnectIntf-server_version"><strong>server_version</strong></a>(self)</dt><dd><tt>Provide server version<br>
|
|
should be implemented<br>
|
|
<br>
|
|
:return: str, server version</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ConnectIntf-show_tables"><strong>show_tables</strong></a>(self)</dt><dd><tt>Show all tables in database<br>
|
|
should be implemented<br>
|
|
<br>
|
|
:return<br>
|
|
Status: indicate if this operation is successful<br>
|
|
tables: list[str], list of table names</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> <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="IndexType">class <strong>IndexType</strong></a>(<a href="enum.html#IntEnum">enum.IntEnum</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>An enumeration.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="client.Abstract.html#IndexType">IndexType</a></dd>
|
|
<dd><a href="enum.html#IntEnum">enum.IntEnum</a></dd>
|
|
<dd><a href="builtins.html#int">builtins.int</a></dd>
|
|
<dd><a href="enum.html#Enum">enum.Enum</a></dd>
|
|
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
|
</dl>
|
|
<hr>
|
|
Data and other attributes defined here:<br>
|
|
<dl><dt><strong>IDMAP</strong> = <IndexType.IDMAP: 1></dl>
|
|
|
|
<dl><dt><strong>INVALIDE</strong> = <IndexType.INVALIDE: 0></dl>
|
|
|
|
<dl><dt><strong>IVFLAT</strong> = <IndexType.IVFLAT: 2></dl>
|
|
|
|
<hr>
|
|
Data descriptors inherited from <a href="enum.html#Enum">enum.Enum</a>:<br>
|
|
<dl><dt><strong>name</strong></dt>
|
|
<dd><tt>The name of the Enum member.</tt></dd>
|
|
</dl>
|
|
<dl><dt><strong>value</strong></dt>
|
|
<dd><tt>The value of the Enum member.</tt></dd>
|
|
</dl>
|
|
<hr>
|
|
Data descriptors inherited from <a href="enum.html#EnumMeta">enum.EnumMeta</a>:<br>
|
|
<dl><dt><strong>__members__</strong></dt>
|
|
<dd><tt>Returns a mapping of member name->value.<br>
|
|
<br>
|
|
This mapping lists all enum members, including aliases. Note that this<br>
|
|
is a read-only view of the internal mapping.</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="QueryResult">class <strong>QueryResult</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Query result<br>
|
|
<br>
|
|
:type id: int64<br>
|
|
:param id: id of the vector<br>
|
|
<br>
|
|
:type score: float<br>
|
|
:param score: Vector similarity 0 <= score <= 100<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="QueryResult-__init__"><strong>__init__</strong></a>(self, id, score)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="QueryResult-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return repr(self).</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> <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="Range">class <strong>Range</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt><a href="#Range">Range</a> information<br>
|
|
<br>
|
|
:type start: str<br>
|
|
:param start: <a href="#Range">Range</a> start value<br>
|
|
<br>
|
|
:type end: str<br>
|
|
:param end: <a href="#Range">Range</a> end value<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="Range-__init__"><strong>__init__</strong></a>(self, start, end)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</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> <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="RowRecord">class <strong>RowRecord</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Record inserted<br>
|
|
<br>
|
|
:type vector_data: binary str<br>
|
|
:param vector_data: (Required) a vector<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="RowRecord-__init__"><strong>__init__</strong></a>(self, vector_data)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</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> <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="TableSchema">class <strong>TableSchema</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Table Schema<br>
|
|
<br>
|
|
:type table_name: str<br>
|
|
:param table_name: (Required) name of table<br>
|
|
<br>
|
|
:type index_type: <a href="#IndexType">IndexType</a><br>
|
|
:param index_type: (Optional) index type, default = 0<br>
|
|
<br>
|
|
`<a href="#IndexType">IndexType</a>`: 0-invalid, 1-idmap, 2-ivflat<br>
|
|
<br>
|
|
:type dimension: int64<br>
|
|
:param dimension: (Required) dimension of vector<br>
|
|
<br>
|
|
:type store_raw_vector: bool<br>
|
|
:param store_raw_vector: (Optional) default = False<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="TableSchema-__init__"><strong>__init__</strong></a>(self, table_name, dimension=0, index_type=<IndexType.INVALIDE: 0>, store_raw_vector=False)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</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> <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="TopKQueryResult">class <strong>TopKQueryResult</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>TopK query results<br>
|
|
<br>
|
|
:type query_results: list[<a href="#QueryResult">QueryResult</a>]<br>
|
|
:param query_results: TopK query results<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="TopKQueryResult-__init__"><strong>__init__</strong></a>(self, query_results)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="TopKQueryResult-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return repr(self).</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>
|
|
</body></html> |