milvus package

Submodules

milvus.settings module

class milvus.settings.ColorFulFormatColMixin[source]

Bases: object

format_col(message_str, level_name)[source]
class milvus.settings.ColorfulFormatter(fmt=None, datefmt=None, style='%')[source]

Bases: logging.Formatter, milvus.settings.ColorFulFormatColMixin

format(record)[source]

Format the specified record as text.

The record's attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

class milvus.settings.DefaultConfig[source]

Bases: object

GRPC_PORT = '19530'
GRPC_URI = 'tcp://127.0.0.1:19530'

Module contents

milvus.Milvus

alias of milvus.client.grpc_client.GrpcMilvus

class milvus.Prepare[source]

Bases: object

classmethod cmd(cmd)[source]
classmethod delete_param(table_name, start_date, end_date)[source]
classmethod index(index_type, nlist)[source]
Parameters
  • index_type (IndexType) -- index type

  • nlist --

Returns

classmethod index_param(table_name, index_param)[source]
classmethod insert_param(table_name, vectors, ids=None)[source]
classmethod range(start_date, end_date)[source]

Parser a 'yyyy-mm-dd' like str or date/datetime object to Range object

Range: (start_date, end_date]

start_date : '2019-05-25'

Parameters
  • start_date (str, date, datetime) -- start date

  • end_date (str, date, datetime) -- end date

Returns

Range object

classmethod ranges(ranges)[source]

prepare query_ranges

Parameters

ranges -- prepare query_ranges

Returns

list[Range]

classmethod search_param(table_name, query_records, query_ranges, topk, nprobe)[source]
classmethod search_vector_in_files_param(table_name, query_records, query_ranges, topk, nprobe, ids)[source]
classmethod table_name(table_name)[source]
classmethod table_schema(param)[source]
Parameters

param (dict) --

(Required)

`example param={'table_name': 'name',

'dimension': 16, 'index_file_size': 1024 'metric_type': MetricType.L2 }`

Returns

ttypes.TableSchema object

class milvus.Status(code=0, message='Success')[source]

Bases: object

Attribute code

int (optional) default as ok

Attribute message

str (optional) current status message

BUILD_INDEX_ERROR = 21
CACHE_FAILED = 16
CANNOT_CREATE_FILE = 18
CANNOT_CREATE_FOLDER = 17
CANNOT_DELETE_FILE = 20
CANNOT_DELETE_FOLDER = 19
CONNECT_FAILED = 2
FILE_NOT_FOUND = 14
ILLEGAL_ARGUMENT = 5
ILLEGAL_DIMENSION = 7
ILLEGAL_INDEX_TYPE = 8
ILLEGAL_METRIC_TYPE = 23
ILLEGAL_NLIST = 22
ILLEGAL_RANGE = 6
ILLEGAL_ROWRECORD = 11
ILLEGAL_SEARCH_RESULT = 13
ILLEGAL_TABLE_NAME = 9
ILLEGAL_TOPK = 10
ILLEGAL_VECTOR_ID = 12
META_FAILED = 15
OK()[source]
OUT_OF_MEMORY = 24
PERMISSION_DENIED = 3
SUCCESS = 0
TABLE_NOT_EXISTS = 4
UNEXPECTED_ERROR = 1
class milvus.IndexType[source]

Bases: enum.IntEnum

An enumeration.

FLAT = 1
INVALID = 0
IVFLAT = 2
IVF_FLAT = 2
IVF_SQ8 = 3
IVF_SQ8H = 5
IVF_SQ8_H = 5
MIX_NSG = 4
class milvus.MetricType[source]

Bases: enum.IntEnum

An enumeration.

IP = 2
L2 = 1
exception milvus.ParamError[source]

Bases: ValueError

Param of interface is illegal

exception milvus.ConnectError[source]

Bases: ValueError

Connect server failed

exception milvus.NotConnectError[source]

Bases: milvus.client.exceptions.ConnectError

Disconnect error

exception milvus.RepeatingConnectError[source]

Bases: milvus.client.exceptions.ConnectError

Try to connect repeatedly