mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
feat(python): build docs, fix examples bug
Former-commit-id: 79d4b0556dc9caeb432bf7981fc32e4302e48411
This commit is contained in:
parent
3367c1543f
commit
e651a07e24
@ -128,7 +128,7 @@ class ConnectIntf(object):
|
||||
:type uri: str
|
||||
:param uri: (Optional) uri
|
||||
|
||||
:return Status, indicate if connect is successful
|
||||
:return: Status, indicate if connect is successful
|
||||
"""
|
||||
_abstract()
|
||||
|
||||
@ -137,7 +137,7 @@ class ConnectIntf(object):
|
||||
connected, connection status
|
||||
Should be implemented
|
||||
|
||||
:return Status, indicate if connect is successful
|
||||
:return: Status, indicate if connect is successful
|
||||
"""
|
||||
_abstract()
|
||||
|
||||
@ -146,7 +146,7 @@ class ConnectIntf(object):
|
||||
Disconnect, server will be disconnected after disconnect return SUCCESS
|
||||
Should be implemented
|
||||
|
||||
:return Status, indicate if connect is successful
|
||||
:return: Status, indicate if connect is successful
|
||||
"""
|
||||
_abstract()
|
||||
|
||||
@ -158,7 +158,7 @@ class ConnectIntf(object):
|
||||
:type param: TableSchema
|
||||
:param param: provide table information to be created
|
||||
|
||||
:return Status, indicate if connect is successful
|
||||
:return: Status, indicate if connect is successful
|
||||
"""
|
||||
_abstract()
|
||||
|
||||
@ -170,7 +170,7 @@ class ConnectIntf(object):
|
||||
:type table_name: str
|
||||
:param table_name: table_name of the deleting table
|
||||
|
||||
:return Status, indicate if connect is successful
|
||||
:return: Status, indicate if connect is successful
|
||||
"""
|
||||
_abstract()
|
||||
|
||||
@ -185,7 +185,7 @@ class ConnectIntf(object):
|
||||
:type records: list[RowRecord]
|
||||
:param records: list of vectors been inserted
|
||||
|
||||
:returns
|
||||
:returns:
|
||||
Status : indicate if vectors inserted successfully
|
||||
ids :list of id, after inserted every vector is given a id
|
||||
"""
|
||||
@ -209,7 +209,7 @@ class ConnectIntf(object):
|
||||
:type top_k: int
|
||||
:param top_k: how many similar vectors will be searched
|
||||
|
||||
:returns
|
||||
:returns:
|
||||
Status: indicate if query is successful
|
||||
query_results: list[TopKQueryResult]
|
||||
"""
|
||||
@ -223,7 +223,7 @@ class ConnectIntf(object):
|
||||
:type table_name: str
|
||||
:param table_name: which table to be shown
|
||||
|
||||
:returns
|
||||
:returns:
|
||||
Status: indicate if query is successful
|
||||
table_schema: TableSchema, given when operation is successful
|
||||
"""
|
||||
@ -237,7 +237,7 @@ class ConnectIntf(object):
|
||||
:type table_name, str
|
||||
:param table_name, target table name.
|
||||
|
||||
:returns
|
||||
:returns:
|
||||
Status: indicate if operation is successful
|
||||
count: int, table row count
|
||||
"""
|
||||
@ -248,7 +248,7 @@ class ConnectIntf(object):
|
||||
Show all tables in database
|
||||
should be implemented
|
||||
|
||||
:return
|
||||
:return:
|
||||
Status: indicate if this operation is successful
|
||||
tables: list[str], list of table names
|
||||
"""
|
||||
|
||||
@ -26,8 +26,8 @@ from client.Exceptions import (
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
__VERSION__ = '0.0.1'
|
||||
__NAME__ = 'Thrift_Client'
|
||||
__VERSION__ = '0.1.0'
|
||||
__NAME__ = 'Milvus Python SDK'
|
||||
|
||||
|
||||
class Prepare(object):
|
||||
@ -39,13 +39,16 @@ class Prepare(object):
|
||||
index_type=IndexType.INVALIDE,
|
||||
store_raw_vector = False):
|
||||
"""
|
||||
:type table_name: str
|
||||
:type dimension: int
|
||||
:type index_type: IndexType
|
||||
:type store_raw_vector: bool
|
||||
:param table_name: (Required) name of table
|
||||
:param dimension: (Required) dimension of the table
|
||||
:param index_type: (Optional) index type, default = IndexType.INVALID
|
||||
:param store_raw_vector: (Optional) default = False
|
||||
|
||||
:param table_name: str, (Required) name of table
|
||||
:param index_type: IndexType, (Required) index type, default = IndexType.INVALID
|
||||
:param dimension: int64, (Optional) dimension of the table
|
||||
:param store_raw_vector: bool, (Optional) default = False
|
||||
|
||||
:return: TableSchema
|
||||
:return: TableSchema object
|
||||
"""
|
||||
temp = TableSchema(table_name,dimension, index_type, store_raw_vector)
|
||||
|
||||
@ -57,10 +60,12 @@ class Prepare(object):
|
||||
@classmethod
|
||||
def range(cls, start, end):
|
||||
"""
|
||||
:param start: str, (Required) range start
|
||||
:param end: str (Required) range end
|
||||
:type start: str
|
||||
:type end: str
|
||||
:param start: (Required) range start
|
||||
:param end: (Required) range end
|
||||
|
||||
:return Range
|
||||
:return: Range object
|
||||
"""
|
||||
temp = Range(start=start, end=end)
|
||||
return ttypes.Range(start_value=temp.start, end_value=temp.end)
|
||||
@ -68,9 +73,12 @@ class Prepare(object):
|
||||
@classmethod
|
||||
def row_record(cls, vector_data):
|
||||
"""
|
||||
Record inserted
|
||||
Transfer a float binary str to RowRecord and return
|
||||
|
||||
:param vector_data: float binary str, (Required) a binary str
|
||||
:type vector_data: bytearray or bytes
|
||||
:param vector_data: (Required) binary vector to store
|
||||
|
||||
:return: RowRecord object
|
||||
|
||||
"""
|
||||
temp = RowRecord(vector_data)
|
||||
@ -78,6 +86,9 @@ class Prepare(object):
|
||||
|
||||
|
||||
class Milvus(ConnectIntf):
|
||||
"""
|
||||
The Milvus object is used to connect and communicate with the server
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.status = None
|
||||
@ -88,6 +99,20 @@ class Milvus(ConnectIntf):
|
||||
return '{}'.format(self.status)
|
||||
|
||||
def connect(self, host='localhost', port='9090', uri=None):
|
||||
"""
|
||||
Connect method should be called before any operations.
|
||||
Server will be connected after connect return OK
|
||||
|
||||
:type host: str
|
||||
:type port: str
|
||||
:type uri: str
|
||||
:param host: (Required) host of the server
|
||||
:param port: (Required) port of the server
|
||||
:param uri: (Optional)
|
||||
|
||||
:return: Status, indicate if connect is successful
|
||||
:rtype: Status
|
||||
"""
|
||||
# TODO URI
|
||||
if self.status and self.status == Status.SUCCESS:
|
||||
raise RepeatingConnectError("You have already connected!")
|
||||
@ -110,9 +135,21 @@ class Milvus(ConnectIntf):
|
||||
|
||||
@property
|
||||
def connected(self):
|
||||
"""
|
||||
Check if client is connected to the server
|
||||
|
||||
:return: if client is connected
|
||||
:rtype bool
|
||||
"""
|
||||
return self.status == Status.SUCCESS
|
||||
|
||||
def disconnect(self):
|
||||
"""
|
||||
Disconnect the client
|
||||
|
||||
:return: Status, indicate if disconnect is successful
|
||||
:rtype: Status
|
||||
"""
|
||||
|
||||
if not self._transport:
|
||||
raise DisconnectNotConnectedClientError('Error')
|
||||
@ -130,11 +167,13 @@ class Milvus(ConnectIntf):
|
||||
def create_table(self, param):
|
||||
"""Create table
|
||||
|
||||
:param param: Provide table information to be created,
|
||||
:type param: TableSchema
|
||||
:param param: Provide table information to be created
|
||||
|
||||
`Please use Prepare.table_schema generate param`
|
||||
|
||||
:return: Status, indicate if operation is successful
|
||||
:rtype: Status
|
||||
"""
|
||||
if not self._client:
|
||||
raise NotConnectError('Please Connect to the server first!')
|
||||
@ -147,11 +186,14 @@ class Milvus(ConnectIntf):
|
||||
return Status(message='Table {} created!'.format(param.table_name))
|
||||
|
||||
def delete_table(self, table_name):
|
||||
"""Delete table
|
||||
"""
|
||||
Delete table with table_name
|
||||
|
||||
:type table_name: str
|
||||
:param table_name: Name of the table being deleted
|
||||
|
||||
:return: Status, indicate if operation is successful
|
||||
:rtype: Status
|
||||
"""
|
||||
try:
|
||||
self._client.DeleteTable(table_name)
|
||||
@ -164,14 +206,19 @@ class Milvus(ConnectIntf):
|
||||
"""
|
||||
Add vectors to table
|
||||
|
||||
:type table_name: str
|
||||
:type records: list[RowRecord]
|
||||
|
||||
:param table_name: table name been inserted
|
||||
:param records: List[RowRecord], list of vectors been inserted
|
||||
:param records: list of vectors been inserted
|
||||
|
||||
`Please use Prepare.row_record generate records`
|
||||
|
||||
:returns:
|
||||
Status : indicate if vectors inserted successfully
|
||||
ids :list of id, after inserted every vector is given a id
|
||||
Status: indicate if vectors inserted successfully
|
||||
|
||||
ids: list of id, after inserted every vector is given a id
|
||||
:rtype: (Status, list(str))
|
||||
"""
|
||||
try:
|
||||
ids = self._client.AddVector(table_name=table_name, record_array=records)
|
||||
@ -184,17 +231,26 @@ class Milvus(ConnectIntf):
|
||||
"""
|
||||
Query vectors in a table
|
||||
|
||||
:param table_name: str, table name been queried
|
||||
:param query_records: list[QueryRecord], all vectors going to be queried
|
||||
|
||||
|
||||
:param query_ranges: Optional ranges for conditional search.
|
||||
If not specified, search whole table
|
||||
:type query_ranges: list[Range]
|
||||
:param table_name: table name been queried
|
||||
:type table_name: str
|
||||
:param query_records: all vectors going to be queried
|
||||
|
||||
`Please use Prepare.query_record generate QueryRecord`
|
||||
|
||||
:type query_records: list[RowRecord]
|
||||
:param top_k: int, how many similar vectors will be searched
|
||||
:param query_ranges, (Optional) list[Range], search range
|
||||
:type top_k: int
|
||||
|
||||
:returns: (Status, res)
|
||||
|
||||
:returns:
|
||||
Status: indicate if query is successful
|
||||
res: list[TopKQueryResult], return when operation is successful
|
||||
|
||||
res: return when operation is successful
|
||||
:rtype: (Status, list[TopKQueryResult])
|
||||
"""
|
||||
res = []
|
||||
try:
|
||||
@ -219,17 +275,17 @@ class Milvus(ConnectIntf):
|
||||
"""
|
||||
Show table information
|
||||
|
||||
:param table_name: str, which table to be shown
|
||||
:type table_name: str
|
||||
:param table_name: which table to be shown
|
||||
|
||||
:returns:
|
||||
:returns: (Status, table_schema)
|
||||
Status: indicate if query is successful
|
||||
table_schema: TableSchema, return when operation is successful
|
||||
table_schema: return when operation is successful
|
||||
:rtype: (Status, TableSchema)
|
||||
"""
|
||||
try:
|
||||
temp = self._client.DescribeTable(table_name)
|
||||
|
||||
# res = TableSchema(table_name=temp.table_name, dimension=temp.dimension,
|
||||
# index_type=temp.index_type, store_raw_vector=temp.store_raw_vector)
|
||||
except (TApplicationException, TException) as e:
|
||||
LOGGER.error('{}'.format(e))
|
||||
return Status(Status.PERMISSION_DENIED, str(e)), None
|
||||
@ -241,14 +297,17 @@ class Milvus(ConnectIntf):
|
||||
|
||||
:return:
|
||||
Status: indicate if this operation is successful
|
||||
tables: list[str], list of table names, return when operation
|
||||
|
||||
tables: list of table names, return when operation
|
||||
is successful
|
||||
:rtype:
|
||||
(Status, list[str])
|
||||
"""
|
||||
try:
|
||||
res = self._client.ShowTables()
|
||||
tables = []
|
||||
if res:
|
||||
tables, _ = res
|
||||
tables = res
|
||||
|
||||
except (TApplicationException, TException) as e:
|
||||
LOGGER.error('{}'.format(e))
|
||||
@ -259,16 +318,17 @@ class Milvus(ConnectIntf):
|
||||
"""
|
||||
Get table row count
|
||||
|
||||
:type table_name, str
|
||||
:param table_name, target table name.
|
||||
:type table_name: str
|
||||
:param table_name: target table name.
|
||||
|
||||
:returns:
|
||||
Status: indicate if operation is successful
|
||||
|
||||
res: int, table row count
|
||||
|
||||
"""
|
||||
try:
|
||||
count, _ = self._client.GetTableRowCount(table_name)
|
||||
count = self._client.GetTableRowCount(table_name)
|
||||
|
||||
except (TApplicationException, TException) as e:
|
||||
LOGGER.error('{}'.format(e))
|
||||
@ -280,6 +340,7 @@ class Milvus(ConnectIntf):
|
||||
Provide client version
|
||||
|
||||
:return: Client version
|
||||
:rtype: str
|
||||
"""
|
||||
return __VERSION__
|
||||
|
||||
@ -299,6 +360,7 @@ class Milvus(ConnectIntf):
|
||||
Provide server status
|
||||
|
||||
:return: Server status
|
||||
:rtype : str
|
||||
"""
|
||||
if not self.connected:
|
||||
raise NotConnectError('You have to connect first')
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
class Status(object):
|
||||
"""
|
||||
:attribute code : int (optional) default as ok
|
||||
:attribute message : str (optional) current status message
|
||||
:attribute code: int (optional) default as ok
|
||||
|
||||
:attribute message: str (optional) current status message
|
||||
"""
|
||||
SUCCESS = 0
|
||||
CONNECT_FAILED = 1
|
||||
|
||||
27
python/sdk/doc/en/API/sdk.client.rst
Normal file
27
python/sdk/doc/en/API/sdk.client.rst
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
sdk.client.Client module
|
||||
===============================
|
||||
|
||||
sdk.client.Client.Milvus
|
||||
--------------------------------
|
||||
|
||||
.. autoclass:: client.Client.Milvus
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
sdk.client.Clinet.Prepare
|
||||
--------------------------------
|
||||
|
||||
.. autoclass:: client.Client.Prepare
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
sdk.client.Status module
|
||||
======================================
|
||||
|
||||
.. automodule:: client.Status
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
0
python/sdk/doc/en/QuickStart.rst
Normal file
0
python/sdk/doc/en/QuickStart.rst
Normal file
11
python/sdk/doc/en/api.rst
Normal file
11
python/sdk/doc/en/api.rst
Normal file
@ -0,0 +1,11 @@
|
||||
API
|
||||
***
|
||||
|
||||
client package
|
||||
==============================
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
API/sdk.client.rst
|
||||
61
python/sdk/doc/en/conf.py
Normal file
61
python/sdk/doc/en/conf.py
Normal file
@ -0,0 +1,61 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# http://www.sphinx-doc.org/en/master/config
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
os.path.join('..', '..')
|
||||
))
|
||||
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'MilvusPythonSDK'
|
||||
copyright = '2019, Zilliz'
|
||||
author = 'YangXuan'
|
||||
|
||||
# The full version, including alpha/beta/rc tags
|
||||
release = '0.0.1'
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
# 'sphinx.ext.viewcode'
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
|
||||
master_doc = 'index'
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
24
python/sdk/doc/en/index.rst
Normal file
24
python/sdk/doc/en/index.rst
Normal file
@ -0,0 +1,24 @@
|
||||
.. MilvusSDK documentation master file, created by
|
||||
sphinx-quickstart on Thu Jun 13 11:42:09 2019.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<div style="font-size:80px;font-family:Arial;font-weight:bold;">
|
||||
<i class="fa fa-check-square" style="color:green;padding-right:5px;"></i>
|
||||
Milvus
|
||||
</div>
|
||||
|
||||
Milvus Python SDK
|
||||
---------------------------
|
||||
|
||||
Using Milvus with Python
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:hidden:
|
||||
|
||||
QuickStart
|
||||
api
|
||||
@ -1,353 +0,0 @@
|
||||
<!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>
|
||||
@ -1,218 +0,0 @@
|
||||
<!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>
|
||||
@ -1,349 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: module Exceptions</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>Exceptions</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/Exceptions.py">/home/yangxuan/vecwise_engine/python/sdk/client/Exceptions.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#ValueError">builtins.ValueError</a>(<a href="builtins.html#Exception">builtins.Exception</a>)
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="client.Exceptions.html#ConnectError">ConnectError</a>
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="client.Exceptions.html#NotConnectError">NotConnectError</a>
|
||||
</font></dt><dt><font face="helvetica, arial"><a href="client.Exceptions.html#RepeatingConnectError">RepeatingConnectError</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
<dt><font face="helvetica, arial"><a href="client.Exceptions.html#DisconnectNotConnectedClientError">DisconnectNotConnectedClientError</a>
|
||||
</font></dt><dt><font face="helvetica, arial"><a href="client.Exceptions.html#ParamError">ParamError</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="ConnectError">class <strong>ConnectError</strong></a>(<a href="builtins.html#ValueError">builtins.ValueError</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Inappropriate argument value (of correct type).<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="client.Exceptions.html#ConnectError">ConnectError</a></dd>
|
||||
<dd><a href="builtins.html#ValueError">builtins.ValueError</a></dd>
|
||||
<dd><a href="builtins.html#Exception">builtins.Exception</a></dd>
|
||||
<dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd>
|
||||
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#ValueError">builtins.ValueError</a>:<br>
|
||||
<dl><dt><a name="ConnectError-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ConnectError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Create and return a new object. See help(type) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><a name="ConnectError-__delattr__"><strong>__delattr__</strong></a>(self, name, /)</dt><dd><tt>Implement delattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ConnectError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return getattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ConnectError-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>helper for pickle</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ConnectError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><tt>Return repr(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ConnectError-__setattr__"><strong>__setattr__</strong></a>(self, name, value, /)</dt><dd><tt>Implement setattr(self, name, value).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ConnectError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="ConnectError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><tt>Return str(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ConnectError-with_traceback"><strong>with_traceback</strong></a>(...)</dt><dd><tt>Exception.<a href="#ConnectError-with_traceback">with_traceback</a>(tb) --<br>
|
||||
set self.<strong>__traceback__</strong> to tb and return self.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><strong>__cause__</strong></dt>
|
||||
<dd><tt>exception cause</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__context__</strong></dt>
|
||||
<dd><tt>exception context</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__suppress_context__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__traceback__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</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="DisconnectNotConnectedClientError">class <strong>DisconnectNotConnectedClientError</strong></a>(<a href="builtins.html#ValueError">builtins.ValueError</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Inappropriate argument value (of correct type).<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="client.Exceptions.html#DisconnectNotConnectedClientError">DisconnectNotConnectedClientError</a></dd>
|
||||
<dd><a href="builtins.html#ValueError">builtins.ValueError</a></dd>
|
||||
<dd><a href="builtins.html#Exception">builtins.Exception</a></dd>
|
||||
<dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd>
|
||||
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#ValueError">builtins.ValueError</a>:<br>
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Create and return a new object. See help(type) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-__delattr__"><strong>__delattr__</strong></a>(self, name, /)</dt><dd><tt>Implement delattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return getattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>helper for pickle</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><tt>Return repr(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-__setattr__"><strong>__setattr__</strong></a>(self, name, value, /)</dt><dd><tt>Implement setattr(self, name, value).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><tt>Return str(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="DisconnectNotConnectedClientError-with_traceback"><strong>with_traceback</strong></a>(...)</dt><dd><tt>Exception.<a href="#DisconnectNotConnectedClientError-with_traceback">with_traceback</a>(tb) --<br>
|
||||
set self.<strong>__traceback__</strong> to tb and return self.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><strong>__cause__</strong></dt>
|
||||
<dd><tt>exception cause</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__context__</strong></dt>
|
||||
<dd><tt>exception context</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__suppress_context__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__traceback__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</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="NotConnectError">class <strong>NotConnectError</strong></a>(<a href="client.Exceptions.html#ConnectError">ConnectError</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Inappropriate argument value (of correct type).<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="client.Exceptions.html#NotConnectError">NotConnectError</a></dd>
|
||||
<dd><a href="client.Exceptions.html#ConnectError">ConnectError</a></dd>
|
||||
<dd><a href="builtins.html#ValueError">builtins.ValueError</a></dd>
|
||||
<dd><a href="builtins.html#Exception">builtins.Exception</a></dd>
|
||||
<dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd>
|
||||
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="client.Exceptions.html#ConnectError">ConnectError</a>:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#ValueError">builtins.ValueError</a>:<br>
|
||||
<dl><dt><a name="NotConnectError-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotConnectError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Create and return a new object. See help(type) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><a name="NotConnectError-__delattr__"><strong>__delattr__</strong></a>(self, name, /)</dt><dd><tt>Implement delattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotConnectError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return getattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotConnectError-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>helper for pickle</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotConnectError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><tt>Return repr(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotConnectError-__setattr__"><strong>__setattr__</strong></a>(self, name, value, /)</dt><dd><tt>Implement setattr(self, name, value).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotConnectError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="NotConnectError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><tt>Return str(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="NotConnectError-with_traceback"><strong>with_traceback</strong></a>(...)</dt><dd><tt>Exception.<a href="#NotConnectError-with_traceback">with_traceback</a>(tb) --<br>
|
||||
set self.<strong>__traceback__</strong> to tb and return self.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><strong>__cause__</strong></dt>
|
||||
<dd><tt>exception cause</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__context__</strong></dt>
|
||||
<dd><tt>exception context</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__suppress_context__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__traceback__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</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="ParamError">class <strong>ParamError</strong></a>(<a href="builtins.html#ValueError">builtins.ValueError</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Inappropriate argument value (of correct type).<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="client.Exceptions.html#ParamError">ParamError</a></dd>
|
||||
<dd><a href="builtins.html#ValueError">builtins.ValueError</a></dd>
|
||||
<dd><a href="builtins.html#Exception">builtins.Exception</a></dd>
|
||||
<dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd>
|
||||
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#ValueError">builtins.ValueError</a>:<br>
|
||||
<dl><dt><a name="ParamError-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ParamError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Create and return a new object. See help(type) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><a name="ParamError-__delattr__"><strong>__delattr__</strong></a>(self, name, /)</dt><dd><tt>Implement delattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ParamError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return getattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ParamError-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>helper for pickle</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ParamError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><tt>Return repr(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ParamError-__setattr__"><strong>__setattr__</strong></a>(self, name, value, /)</dt><dd><tt>Implement setattr(self, name, value).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ParamError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="ParamError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><tt>Return str(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="ParamError-with_traceback"><strong>with_traceback</strong></a>(...)</dt><dd><tt>Exception.<a href="#ParamError-with_traceback">with_traceback</a>(tb) --<br>
|
||||
set self.<strong>__traceback__</strong> to tb and return self.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><strong>__cause__</strong></dt>
|
||||
<dd><tt>exception cause</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__context__</strong></dt>
|
||||
<dd><tt>exception context</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__suppress_context__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__traceback__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</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="RepeatingConnectError">class <strong>RepeatingConnectError</strong></a>(<a href="client.Exceptions.html#ConnectError">ConnectError</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Inappropriate argument value (of correct type).<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="client.Exceptions.html#RepeatingConnectError">RepeatingConnectError</a></dd>
|
||||
<dd><a href="client.Exceptions.html#ConnectError">ConnectError</a></dd>
|
||||
<dd><a href="builtins.html#ValueError">builtins.ValueError</a></dd>
|
||||
<dd><a href="builtins.html#Exception">builtins.Exception</a></dd>
|
||||
<dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd>
|
||||
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="client.Exceptions.html#ConnectError">ConnectError</a>:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#ValueError">builtins.ValueError</a>:<br>
|
||||
<dl><dt><a name="RepeatingConnectError-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RepeatingConnectError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Create and return a new object. See help(type) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><a name="RepeatingConnectError-__delattr__"><strong>__delattr__</strong></a>(self, name, /)</dt><dd><tt>Implement delattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RepeatingConnectError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return getattr(self, name).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RepeatingConnectError-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>helper for pickle</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RepeatingConnectError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><tt>Return repr(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RepeatingConnectError-__setattr__"><strong>__setattr__</strong></a>(self, name, value, /)</dt><dd><tt>Implement setattr(self, name, value).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RepeatingConnectError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="RepeatingConnectError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><tt>Return str(self).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RepeatingConnectError-with_traceback"><strong>with_traceback</strong></a>(...)</dt><dd><tt>Exception.<a href="#RepeatingConnectError-with_traceback">with_traceback</a>(tb) --<br>
|
||||
set self.<strong>__traceback__</strong> to tb and return self.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
||||
<dl><dt><strong>__cause__</strong></dt>
|
||||
<dd><tt>exception cause</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__context__</strong></dt>
|
||||
<dd><tt>exception context</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__suppress_context__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>__traceback__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</dl>
|
||||
</td></tr></table></td></tr></table>
|
||||
</body></html>
|
||||
@ -1,74 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: module Status</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>Status</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/Status.py">/home/yangxuan/vecwise_engine/python/sdk/client/Status.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.Status.html#Status">Status</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="Status">class <strong>Status</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>:attribute code : int (optional) default as ok<br>
|
||||
:attribute message : str (optional) current status message<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="Status-__eq__"><strong>__eq__</strong></a>(self, other)</dt><dd><tt>Make <a href="#Status">Status</a> comparable with self by code</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Status-__init__"><strong>__init__</strong></a>(self, code=0, message=None)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Status-__ne__"><strong>__ne__</strong></a>(self, other)</dt><dd><tt>Return self!=value.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Status-__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>
|
||||
<hr>
|
||||
Data and other attributes defined here:<br>
|
||||
<dl><dt><strong>CONNECT_FAILED</strong> = 1</dl>
|
||||
|
||||
<dl><dt><strong>ILLEGAL_ARGUMENT</strong> = 4</dl>
|
||||
|
||||
<dl><dt><strong>ILLEGAL_DIMENSION</strong> = 6</dl>
|
||||
|
||||
<dl><dt><strong>ILLEGAL_RANGE</strong> = 5</dl>
|
||||
|
||||
<dl><dt><strong>PERMISSION_DENIED</strong> = 2</dl>
|
||||
|
||||
<dl><dt><strong>SUCCESS</strong> = 0</dl>
|
||||
|
||||
<dl><dt><strong>TABLE_NOT_EXISTS</strong> = 3</dl>
|
||||
|
||||
<dl><dt><strong>__hash__</strong> = None</dl>
|
||||
|
||||
</td></tr></table></td></tr></table>
|
||||
</body></html>
|
||||
@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: package 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/__init__.py">/home/yangxuan/vecwise_engine/python/sdk/client/__init__.py</a></font></td></tr></table>
|
||||
<p><tt>client module</tt></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>Package Contents</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="client.Abstract.html">Abstract</a><br>
|
||||
</td><td width="25%" valign=top><a href="client.Client.html">Client</a><br>
|
||||
</td><td width="25%" valign=top><a href="client.Exceptions.html">Exceptions</a><br>
|
||||
</td><td width="25%" valign=top><a href="client.Status.html">Status</a><br>
|
||||
</td></tr></table></td></tr></table>
|
||||
</body></html>
|
||||
@ -11,7 +11,7 @@ def main():
|
||||
|
||||
# Connect
|
||||
# Please change HOST and PORT to correct one
|
||||
param = {'host': 'HOST', 'port': 'PORT'}
|
||||
param = {'host': '192.168.1.121', 'port': '33001'}
|
||||
cnn_status = milvus.connect(**param)
|
||||
print('# Connect Status: {}'.format(cnn_status))
|
||||
|
||||
@ -22,29 +22,44 @@ def main():
|
||||
# Get server version
|
||||
print('# Server version: {}'.format(milvus.server_version()))
|
||||
|
||||
# Show tables and their description
|
||||
status, tables = milvus.show_tables()
|
||||
print('# Show tables: {}'.format(tables))
|
||||
|
||||
# Create table
|
||||
# 01.Prepare data
|
||||
param = {
|
||||
'table_name': 'test'+ str(random.randint(0,999)),
|
||||
'dimension': 256,
|
||||
'index_type': IndexType.IDMAP,
|
||||
'store_raw_vector': False
|
||||
}
|
||||
|
||||
# 02.Create table
|
||||
res_status = milvus.create_table(Prepare.table_schema(**param))
|
||||
print('# Create table status: {}'.format(res_status))
|
||||
|
||||
# Describe table
|
||||
# Check if `test01` exists, if not, create a table test01
|
||||
table_name = 'test01'
|
||||
res_status, table = milvus.describe_table(table_name)
|
||||
print('# Describe table status: {}'.format(res_status))
|
||||
print('# Describe table:{}'.format(table))
|
||||
|
||||
# Create table
|
||||
# 01.Prepare data
|
||||
if not table:
|
||||
param = {
|
||||
'table_name': 'test01',
|
||||
'dimension': 256,
|
||||
'index_type': IndexType.IDMAP,
|
||||
'store_raw_vector': False
|
||||
}
|
||||
|
||||
# 02.Create table
|
||||
res_status = milvus.create_table(Prepare.table_schema(**param))
|
||||
print('# Create table status: {}'.format(res_status))
|
||||
|
||||
# # Create table Optional
|
||||
# # 01.Prepare data
|
||||
# param = {
|
||||
# 'table_name': 'test'+ str(random.randint(22,999)),
|
||||
# 'dimension': 256,
|
||||
# 'index_type': IndexType.IDMAP,
|
||||
# 'store_raw_vector': False
|
||||
# }
|
||||
#
|
||||
# # 02.Create table
|
||||
# res_status = milvus.create_table(Prepare.table_schema(**param))
|
||||
# print('# Create table status: {}'.format(res_status))
|
||||
|
||||
# Show tables and their description
|
||||
status, tables = milvus.show_tables()
|
||||
print('# Show tables: {}'.format(tables))
|
||||
|
||||
# Add vectors to table 'test01'
|
||||
# 01. Prepare data
|
||||
dim = 256
|
||||
@ -58,6 +73,12 @@ def main():
|
||||
pprint(ids)
|
||||
|
||||
# Search vectors
|
||||
# When adding vectors for the first time, server will take at least 5s to
|
||||
# persist vector data, so we have wait for 6s to search correctly
|
||||
import time
|
||||
print('Waiting for 6s...')
|
||||
time.sleep(6) # Wait for server persist vector data
|
||||
|
||||
q_records = [Prepare.row_record(struct.pack(str(dim) + 'd',
|
||||
*[random.random() for _ in range(dim)]))
|
||||
for _ in range(5)]
|
||||
@ -65,7 +86,7 @@ def main():
|
||||
'table_name': 'test01',
|
||||
'query_records': q_records,
|
||||
'top_k': 10,
|
||||
# 'query_ranges': None # Optional
|
||||
# 'query_ranges': # Optional
|
||||
}
|
||||
sta, results = milvus.search_vectors(**param)
|
||||
print('# Search vectors status: {}'.format(sta))
|
||||
@ -76,10 +97,6 @@ def main():
|
||||
print('# Status: {}'.format(sta))
|
||||
print('# Count: {}'.format(result))
|
||||
|
||||
# Delete table 'test01'
|
||||
res_status = milvus.delete_table(table_name)
|
||||
print('# Delete table status: {}'.format(res_status))
|
||||
|
||||
# Disconnect
|
||||
discnn_status = milvus.disconnect()
|
||||
print('# Disconnect Status: {}'.format(discnn_status))
|
||||
|
||||
@ -3,11 +3,11 @@ import setuptools
|
||||
long_description = ''
|
||||
|
||||
setuptools.setup(
|
||||
name="MegaSearch",
|
||||
version="0.0.1",
|
||||
name="Milvus",
|
||||
version="0.1.0",
|
||||
author="XuanYang",
|
||||
author_email="xuan.yang@zilliz.com",
|
||||
description="Sdk for using MegaSearch",
|
||||
description="Python Sdk for Milvus",
|
||||
packages=setuptools.find_packages(),
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3.4",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user