Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ public List<String> listIndexes(MilvusServiceGrpc.MilvusServiceBlockingStub bloc
return new ArrayList<>();
}
rpcUtils.handleResponse(title, response.getStatus());
List<String> indexNames = new ArrayList<>();
response.getIndexDescriptionsList().forEach(index -> {
indexNames.add(index.getIndexName());
});
return indexNames;

return response.getIndexDescriptionsList().stream()
.filter(desc -> request.getFieldName() == null || desc.getFieldName().equals(request.getFieldName()))
.map(IndexDescription::getIndexName)
.collect(Collectors.toList());
}

private void WaitForIndexComplete(MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,7 @@ void testIndex() {
extra.put("efConstruction",64);
indexes.add(IndexParam.builder()
.fieldName("vector")
.indexName("abc")
.indexType(IndexParam.IndexType.HNSW)
.metricType(IndexParam.MetricType.COSINE)
.extraParams(extra)
Expand Down Expand Up @@ -1221,6 +1222,19 @@ void testIndex() {
collProps = descCollResp.getProperties();
Assertions.assertFalse(collProps.containsKey("prop"));

// list indexes
List<String> names = client.listIndexes(ListIndexesReq.builder()
.collectionName(randomCollectionName)
.fieldName("vector")
.build());
Assertions.assertEquals(1, names.size());
Assertions.assertEquals("abc", names.get(0));

names = client.listIndexes(ListIndexesReq.builder()
.collectionName(randomCollectionName)
.build());
Assertions.assertEquals(2, names.size());

// describe scalar index
DescribeIndexResp descResp = client.describeIndex(DescribeIndexReq.builder()
.collectionName(randomCollectionName)
Expand Down Expand Up @@ -1282,7 +1296,7 @@ void testIndex() {
// drop index
client.dropIndex(DropIndexReq.builder()
.collectionName(randomCollectionName)
.indexName("vector")
.indexName("abc")
.build());

IndexParam param = IndexParam.builder()
Expand Down
Loading