public class MilvusGrpcClient extends java.lang.Object implements MilvusClient
MilvusClient
clientVersion
Constructor and Description |
---|
MilvusGrpcClient() |
Modifier and Type | Method and Description |
---|---|
Response |
connect(ConnectParam connectParam)
Connects to Milvus server
|
boolean |
connected() |
Response |
createIndex(CreateIndexParam createIndexParam)
Creates index specified by
indexParam |
Response |
createTable(TableSchemaParam tableSchemaParam)
Creates table specified by
tableSchemaParam |
Response |
deleteByRange(DeleteByRangeParam deleteByRangeParam)
Deletes vectors by date range, specified by
deleteByRangeParam |
DescribeIndexResponse |
describeIndex(TableParam tableParam)
Describes table index specified by
tableParam |
DescribeTableResponse |
describeTable(TableParam tableParam)
Describes table specified by
tableParam |
Response |
disconnect()
Disconnects from Milvus server
|
Response |
dropIndex(TableParam tableParam)
Drops table index specified by
tableParam |
Response |
dropTable(TableParam tableParam)
Drops the table specified by
tableParam |
GetTableRowCountResponse |
getTableRowCount(TableParam tableParam)
Gets current row count of table specified by
tableParam |
HasTableResponse |
hasTable(TableParam tableParam)
Check whether the table specified by
tableParam exists |
InsertResponse |
insert(InsertParam insertParam)
Inserts data specified by
insertParam |
Response |
preloadTable(TableParam tableParam)
Pre-loads table to memory
|
SearchResponse |
search(SearchParam searchParam)
Searches vectors specified by
searchParam |
SearchResponse |
searchInFiles(SearchInFilesParam searchInFilesParam)
Searches vectors in specific files specified by
searchInFilesParam |
Response |
serverStatus()
Prints server status
|
Response |
serverVersion()
Prints server version
|
ShowTablesResponse |
showTables()
Shows current tables
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clientVersion
public Response connect(ConnectParam connectParam)
MilvusClient
connect
in interface MilvusClient
connectParam
- the ConnectParam
object
example usage:
ConnectParam connectParam = new ConnectParam.Builder()
.withHost("localhost")
.withPort("19530")
.build();
Response
ConnectParam
,
Response
public boolean connected()
connected
in interface MilvusClient
true
if the client is connected to Milvus serverpublic Response disconnect() throws java.lang.InterruptedException
MilvusClient
disconnect
in interface MilvusClient
Response
java.lang.InterruptedException
Response
public Response createTable(@Nonnull TableSchemaParam tableSchemaParam)
MilvusClient
tableSchemaParam
createTable
in interface MilvusClient
tableSchemaParam
- the TableSchemaParam
object
example usage:
TableSchema tableSchema = new TableSchema.Builder(tableName, dimension)
.withIndexFileSize(1024)
.withMetricType(MetricType.IP)
.build();
TableSchemaParam tableSchemaParam = new TableSchemaParam.Builder(tableSchema)
.withTimeout(timeout)
.build();
Response
TableSchema
,
TableSchemaParam
,
MetricType
,
Response
public HasTableResponse hasTable(@Nonnull TableParam tableParam)
MilvusClient
tableParam
existshasTable
in interface MilvusClient
tableParam
- the TableParam
object
example usage:
TableParam tableParam = new TableParam.Builder(tableName)
.withTimeout(timeout)
.build();
HasTableResponse
TableParam
,
HasTableResponse
,
Response
public Response dropTable(@Nonnull TableParam tableParam)
MilvusClient
tableParam
dropTable
in interface MilvusClient
tableParam
- the TableParam
object
example usage:
TableParam tableParam = new TableParam.Builder(tableName)
.withTimeout(timeout)
.build();
Response
TableParam
,
Response
public Response createIndex(@Nonnull CreateIndexParam createIndexParam)
MilvusClient
indexParam
createIndex
in interface MilvusClient
createIndexParam
- the IndexParam
object
example usage:
Index index = new Index.Builder()
.withIndexType(IndexType.IVF_SQ8)
.withNList(16384)
.build();
IndexParam indexParam = new IndexParam.Builder(tableName)
.withIndex(index)
.withTimeout(timeout)
.build();
Response
Index
,
CreateIndexParam
,
IndexType
,
Response
public InsertResponse insert(@Nonnull InsertParam insertParam)
MilvusClient
insertParam
insert
in interface MilvusClient
insertParam
- the InsertParam
object
example usage:
InsertParam insertParam = new InsertParam.Builder(tableName, vectors)
.withVectorIds(vectorIds)
.withTimeout(timeout)
.build();
InsertResponse
InsertParam
,
InsertResponse
,
Response
public SearchResponse search(@Nonnull SearchParam searchParam)
MilvusClient
searchParam
search
in interface MilvusClient
searchParam
- the SearchParam
object
example usage:
SearchParam searchParam = new SearchParam.Builder(tableName, vectorsToSearch)
.withTopK(topK)
.withNProbe(nProbe)
.withDateRanges(dateRanges)
.withTimeout(timeout)
.build();
SearchResponse
SearchParam
,
DateRange
,
SearchResponse
,
SearchResponse.QueryResult
,
Response
public SearchResponse searchInFiles(@Nonnull SearchInFilesParam searchInFilesParam)
MilvusClient
searchInFilesParam
searchInFiles
in interface MilvusClient
searchInFilesParam
- the SearchInFilesParam
object
example usage:
SearchParam searchParam = new SearchParam.Builder(tableName, vectorsToSearch)
.withTopK(topK)
.withNProbe(nProbe)
.withDateRanges(dateRanges)
.build();
SearchInFilesParam searchInFilesParam = new SearchInFilesParam.Builder(fileIds, searchParam)
.withTimeout(timeout)
.build();
SearchResponse
SearchInFilesParam
,
SearchParam
,
DateRange
,
SearchResponse
,
SearchResponse.QueryResult
,
Response
public DescribeTableResponse describeTable(@Nonnull TableParam tableParam)
MilvusClient
tableParam
describeTable
in interface MilvusClient
tableParam
- the TableParam
object
example usage:
TableParam tableParam = new TableParam.Builder(tableName)
.withTimeout(timeout)
.build();
DescribeTableResponse
TableParam
,
DescribeTableResponse
,
Response
public ShowTablesResponse showTables()
MilvusClient
showTables
in interface MilvusClient
ShowTablesResponse
ShowTablesResponse
,
Response
public GetTableRowCountResponse getTableRowCount(@Nonnull TableParam tableParam)
MilvusClient
tableParam
getTableRowCount
in interface MilvusClient
tableParam
- the TableParam
object
example usage:
TableParam tableParam = new TableParam.Builder(tableName)
.withTimeout(timeout)
.build();
GetTableRowCountResponse
GetTableRowCountResponse
,
Response
public Response serverStatus()
MilvusClient
serverStatus
in interface MilvusClient
Response
Response
public Response serverVersion()
MilvusClient
serverVersion
in interface MilvusClient
Response
Response
public Response deleteByRange(@Nonnull DeleteByRangeParam deleteByRangeParam)
MilvusClient
deleteByRangeParam
deleteByRange
in interface MilvusClient
deleteByRangeParam
- the DeleteByRangeParam
object
example usage:
DeleteByRangeParam deleteByRangeParam = new DeleteByRangeParam.Builder(dateRange, tableName)
.withTimeout(timeout)
.build();
Response
DeleteByRangeParam
,
DateRange
,
Response
public Response preloadTable(@Nonnull TableParam tableParam)
MilvusClient
preloadTable
in interface MilvusClient
tableParam
- the TableParam
object
example usage:
TableParam tableParam = new TableParam.Builder(tableName)
.withTimeout(timeout)
.build();
Response
TableParam
,
Response
public DescribeIndexResponse describeIndex(@Nonnull TableParam tableParam)
MilvusClient
tableParam
describeIndex
in interface MilvusClient
tableParam
- the TableParam
object
example usage:
TableParam tableParam = new TableParam.Builder(tableName)
.withTimeout(timeout)
.build();
DescribeIndexResponse
TableParam
,
DescribeIndexResponse
,
Index
,
Response
public Response dropIndex(@Nonnull TableParam tableParam)
MilvusClient
tableParam
dropIndex
in interface MilvusClient
tableParam
- the TableParam
object
example usage:
TableParam tableParam = new TableParam.Builder(tableName)
.withTimeout(timeout)
.build();
dropIndex
TableParam
,
Response