From b0cfc0415cc90495808d7dd08cf8c69387edfde1 Mon Sep 17 00:00:00 2001 From: Milvus-doc-bot Date: Sun, 5 Apr 2026 02:10:00 +0000 Subject: [PATCH] Generate SDK reference docs (v2.6.x) --- .../v2.6.x/Collection/AddCollectionField.md | 6 +- .../v2.6.x/Collection/AlterAlias.md | 2 +- .../Collection/AlterCollectionProperties.md | 2 +- .../v2.6.x/Collection/CreateAlias.md | 2 +- .../v2.6.x/Collection/DescribeAlias.md | 2 +- .../v2.6.x/Collection/DescribeCollection.md | 2 +- .../v2.6.x/Collection/DropAlias.md | 2 +- .../Collection/DropCollectionProperties.md | 2 +- .../v2.6.x/Collection/TruncateCollection.md | 69 +++++++++ .../v2.6.x/Management/CreateIndex.md | 2 +- .../v2.6.x/Management/Index/NewAutoIndex.md | 4 +- .../Management/Index/NewBinFlatIndex.md | 4 +- .../Management/Index/NewBinIvfFlatIndex.md | 4 +- .../Management/Index/NewDiskANNIndex.md | 4 +- .../v2.6.x/Management/Index/NewFlatIndex.md | 4 +- .../Management/Index/NewGPUBruteForceIndex.md | 4 +- .../Management/Index/NewGPUCagraIndex.md | 4 +- .../Management/Index/NewGPUIVPFlatIndex.md | 4 +- .../Management/Index/NewGPUIVPPQIndex.md | 4 +- .../Management/Index/NewGenericIndex.md | 2 +- .../v2.6.x/Management/Index/NewHNSWIndex.md | 4 +- .../Management/Index/NewIvfFlatIndex.md | 4 +- .../v2.6.x/Management/Index/NewIvfPQIndex.md | 4 +- .../Management/Index/NewIvfRabitQIndex.md | 4 +- .../v2.6.x/Management/Index/NewIvfSQ8Index.md | 4 +- .../Management/Index/NewJSONPathIndex.md | 4 +- .../Management/Index/NewMinHashLSHIndex.md | 4 +- .../v2.6.x/Management/Index/NewSCANNIndex.md | 4 +- .../Index/NewSparseInvertedIndex.md | 4 +- .../Management/Index/NewSparseWANDIndex.md | 4 +- .../ResourceGroup/UpdateResourceGroup.md | 2 +- .../v2.6.x/Vector/AnnParam/NewAutoAnnParam.md | 2 +- .../Vector/AnnParam/NewCustomAnnParam.md | 2 +- .../v2.6.x/Vector/AnnParam/NewDiskAnnParam.md | 2 +- .../v2.6.x/Vector/AnnParam/NewHNSWAnnParam.md | 2 +- .../v2.6.x/Vector/AnnParam/NewIvfAnnParam.md | 2 +- .../Vector/AnnParam/NewIvfRabitQAnnParam.md | 2 +- .../Vector/AnnParam/NewMinHashLSHAnnParam.md | 2 +- .../Vector/AnnParam/NewSCANNAnnParam.md | 2 +- .../Vector/AnnParam/NewSparseAnnParam.md | 2 +- .../v2.6.x/Vector/QueryIterator.md | 116 +++++++-------- .../v2.6.x/v2/Collections/DataType.md | 2 +- .../v2/Collections/Function/BoostRanker.md | 2 +- .../v2/Collections/Function/DecayRanker.md | 2 +- .../v2/Collections/Function/ModelRanker.md | 2 +- .../v2/Collections/Function/RRFRanker.md | 2 +- .../v2/Collections/Function/WeightedRanker.md | 2 +- .../v2.6.x/v2/Collections/createSchema.md | 48 ++++++ .../v2/Collections/truncateCollection.md | 48 ++++++ .../v2/DataImport/BulkImport/BulkImport.md | 12 ++ .../DataImport/LocalBulkWriter/appendRow.md | 8 + .../VolumeBulkWriter/VolumeBulkWriter.md | 139 ++++++++++++++++++ .../DataImport/VolumeBulkWriter/appendRow.md | 42 ++++++ .../v2/DataImport/VolumeBulkWriter/close.md | 28 ++++ .../v2/DataImport/VolumeBulkWriter/commit.md | 32 ++++ .../VolumeBulkWriter/getBatchFiles.md | 28 ++++ .../VolumeBulkWriter/getTotalRowCount.md | 27 ++++ .../VolumeBulkWriter/getVolumeUploadResult.md | 51 +++++++ .../v2.6.x/Collections/getPkFieldType.md | 1 + .../v2.6.x/Collections/truncateCollection.md | 103 +++++++++++++ .../MilvusClient/Collections/DataType.md | 4 + 61 files changed, 759 insertions(+), 129 deletions(-) create mode 100644 API_Reference/milvus-sdk-go/v2.6.x/Collection/TruncateCollection.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/createSchema.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/truncateCollection.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/BulkImport/BulkImport.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/VolumeBulkWriter.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/appendRow.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/close.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/commit.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getBatchFiles.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getTotalRowCount.md create mode 100644 API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getVolumeUploadResult.md create mode 100644 API_Reference/milvus-sdk-node/v2.6.x/Collections/truncateCollection.md diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Collection/AddCollectionField.md b/API_Reference/milvus-sdk-go/v2.6.x/Collection/AddCollectionField.md index d4b76215cc..fa146dbefb 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Collection/AddCollectionField.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Collection/AddCollectionField.md @@ -20,7 +20,7 @@ err := client.AddCollectionField(ctx, option) The name of the target collection. -- **field** (**[entity.Field](Field.md)*) +- **[field](Field.md)** (**[entity.Field](Field.md)*) The field. @@ -52,10 +52,8 @@ import ( ctx, cancel := context.WithCancel(context.Background()) defer cancel() -milvusAddr := "127.0.0.1:19530" - cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{ - Address: milvusAddr, + Address: "localhost:19530", }) if err != nil { log.Fatal("failed to connect to milvus server: ", err.Error()) diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Collection/AlterAlias.md b/API_Reference/milvus-sdk-go/v2.6.x/Collection/AlterAlias.md index 16b9a843a4..4fd82eb48e 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Collection/AlterAlias.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Collection/AlterAlias.md @@ -16,7 +16,7 @@ err := client.AlterAlias(ctx, option) **PARAMETERS:** -- **alias** (*string*) +- **[alias](Alias.md)** (*string*) The alias name to assign. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Collection/AlterCollectionProperties.md b/API_Reference/milvus-sdk-go/v2.6.x/Collection/AlterCollectionProperties.md index e3340ca393..0d3e70e74b 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Collection/AlterCollectionProperties.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Collection/AlterCollectionProperties.md @@ -17,7 +17,7 @@ err := client.AlterCollectionProperties(ctx, option) **PARAMETERS:** -- **collection** (*string*) +- **[collection](Collection.md)** (*string*) The collection. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Collection/CreateAlias.md b/API_Reference/milvus-sdk-go/v2.6.x/Collection/CreateAlias.md index 7d3ff85215..516563ebc8 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Collection/CreateAlias.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Collection/CreateAlias.md @@ -20,7 +20,7 @@ err := client.CreateAlias(ctx, option) The name of the target collection. -- **alias** (*string*) +- **[alias](Alias.md)** (*string*) The alias name to assign. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Collection/DescribeAlias.md b/API_Reference/milvus-sdk-go/v2.6.x/Collection/DescribeAlias.md index dac01973af..bd908df32e 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Collection/DescribeAlias.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Collection/DescribeAlias.md @@ -16,7 +16,7 @@ result, err := client.DescribeAlias(ctx, option) **PARAMETERS:** -- **alias** (*string*) +- **[alias](Alias.md)** (*string*) The alias name to assign. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Collection/DescribeCollection.md b/API_Reference/milvus-sdk-go/v2.6.x/Collection/DescribeCollection.md index 6e2d56898c..7c02761d8c 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Collection/DescribeCollection.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Collection/DescribeCollection.md @@ -22,7 +22,7 @@ result, err := client.DescribeCollection(ctx, option) **RETURN TYPE:** -*collection* entity.Collection, err error* +*[collection* ](Collection.md)entity.Collection, err error* **RETURNS:** diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Collection/DropAlias.md b/API_Reference/milvus-sdk-go/v2.6.x/Collection/DropAlias.md index 82ee52d10d..7352518b3e 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Collection/DropAlias.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Collection/DropAlias.md @@ -16,7 +16,7 @@ err := client.DropAlias(ctx, option) **PARAMETERS:** -- **alias** (*string*) +- **[alias](Alias.md)** (*string*) The alias name to assign. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Collection/DropCollectionProperties.md b/API_Reference/milvus-sdk-go/v2.6.x/Collection/DropCollectionProperties.md index ad575df540..e35ad32e74 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Collection/DropCollectionProperties.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Collection/DropCollectionProperties.md @@ -16,7 +16,7 @@ err := client.DropCollectionProperties(ctx, option) **PARAMETERS:** -- **collection** (*string*) +- **[collection](Collection.md)** (*string*) The collection. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Collection/TruncateCollection.md b/API_Reference/milvus-sdk-go/v2.6.x/Collection/TruncateCollection.md new file mode 100644 index 0000000000..0356cf2897 --- /dev/null +++ b/API_Reference/milvus-sdk-go/v2.6.x/Collection/TruncateCollection.md @@ -0,0 +1,69 @@ +# TruncateCollection() + +This operation removes all data from a collection but retains the collection schema and structure + +```go +func (c *Client) TruncateCollection(ctx context.Context, option TruncateCollectionOption, callOptions ...grpc.CallOption) error +``` + +## Request Syntax + +```go +err := client.TruncateCollection( + ctx, + milvusclient.NewTruncateCollectionOption("collection_name") +) +``` + +**PARAMETERS:** + +- **collectionName** (*string*) + + The name of the target collection. + +**RETURN TYPE:** + +*error* + +**RETURNS:** + +Returns nil on success, or an error describing what went wrong. + +**EXCEPTIONS:** + +- **error** + + Check `err != nil` for failure details. + +## Example + +```go +package main + +import ( + "context" + "log" + + "github.com/milvus-io/milvus/client/v2/milvusclient" +) + +func main() { + ctx := context.Background() + + client, err := milvusclient.New(ctx, &milvusclient.ClientConfig{ + Address: "localhost:19530", + }) + if err != nil { + log.Fatal(err) + } + + // Truncate collection + err = client.TruncateCollection(ctx, milvusclient.NewTruncateCollectionOption("my_collection")) + if err != nil { + log.Printf("Failed to truncate collection: %v", err) + return + } + + log.Println("Collection truncated successfully") +} +``` diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/CreateIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/CreateIndex.md index bf679d017e..cc8537d716 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/CreateIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/CreateIndex.md @@ -25,7 +25,7 @@ result, err := client.CreateIndex(ctx, option) The name of the field. -- **index** (*[index.Index](Index/Index.md)*) +- **[index](Index/Index.md)** (*[index.Index](Index/Index.md)*) The index. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewAutoIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewAutoIndex.md index f2122010ce..6ebf6b0b41 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewAutoIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewAutoIndex.md @@ -8,13 +8,13 @@ func NewAutoIndex(metricType MetricType) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewBinFlatIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewBinFlatIndex.md index 396ed45751..2d97f4080c 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewBinFlatIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewBinFlatIndex.md @@ -8,13 +8,13 @@ func NewBinFlatIndex(metricType MetricType) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewBinIvfFlatIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewBinIvfFlatIndex.md index 2982fe91ee..0379d51b28 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewBinIvfFlatIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewBinIvfFlatIndex.md @@ -8,7 +8,7 @@ func NewBinIvfFlatIndex(metricType MetricType, nlist int) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -18,7 +18,7 @@ func NewBinIvfFlatIndex(metricType MetricType, nlist int) Index **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewDiskANNIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewDiskANNIndex.md index 729c86d919..3060e5bff8 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewDiskANNIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewDiskANNIndex.md @@ -8,13 +8,13 @@ func NewDiskANNIndex(metricType MetricType) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewFlatIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewFlatIndex.md index bc61530370..854cb127c6 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewFlatIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewFlatIndex.md @@ -8,13 +8,13 @@ func NewFlatIndex(metricType MetricType) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUBruteForceIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUBruteForceIndex.md index 4933e20410..bcf95c58bf 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUBruteForceIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUBruteForceIndex.md @@ -8,13 +8,13 @@ func NewGPUBruteForceIndex(metricType MetricType) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUCagraIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUCagraIndex.md index 2c65e9e8e2..fe83d2df76 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUCagraIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUCagraIndex.md @@ -8,7 +8,7 @@ func NewGPUCagraIndex(metricType MetricType, intermediateGraphDegree, graphDegre **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -22,7 +22,7 @@ func NewGPUCagraIndex(metricType MetricType, intermediateGraphDegree, graphDegre **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUIVPFlatIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUIVPFlatIndex.md index fe8c57f500..5e409da461 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUIVPFlatIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUIVPFlatIndex.md @@ -8,13 +8,13 @@ func NewGPUIVPFlatIndex(metricType MetricType) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUIVPPQIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUIVPPQIndex.md index f0c8561cd6..14b9eff4fd 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUIVPPQIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGPUIVPPQIndex.md @@ -8,13 +8,13 @@ func NewGPUIVPPQIndex(metricType MetricType) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGenericIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGenericIndex.md index b423ed6016..641b326c89 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGenericIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewGenericIndex.md @@ -18,7 +18,7 @@ func NewGenericIndex(name string, params map[string]string) GenericIndex **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewHNSWIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewHNSWIndex.md index ca139d354a..33496fa31a 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewHNSWIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewHNSWIndex.md @@ -8,7 +8,7 @@ func NewHNSWIndex(metricType MetricType, m int, efConstruction int) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -22,7 +22,7 @@ func NewHNSWIndex(metricType MetricType, m int, efConstruction int) Index **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfFlatIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfFlatIndex.md index 57474a610a..dbdd090251 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfFlatIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfFlatIndex.md @@ -8,7 +8,7 @@ func NewIvfFlatIndex(metricType MetricType, nlist int) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -18,7 +18,7 @@ func NewIvfFlatIndex(metricType MetricType, nlist int) Index **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfPQIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfPQIndex.md index 547459bf88..e228a4538c 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfPQIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfPQIndex.md @@ -8,7 +8,7 @@ func NewIvfPQIndex(metricType MetricType, nlist int, m int, nbits int) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -26,7 +26,7 @@ func NewIvfPQIndex(metricType MetricType, nlist int, m int, nbits int) Index **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfRabitQIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfRabitQIndex.md index d7a1974d00..22ffd01894 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfRabitQIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfRabitQIndex.md @@ -8,7 +8,7 @@ func NewIvfRabitQIndex(metricType MetricType, nlist int) *ivfRabitQIndex **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -18,7 +18,7 @@ func NewIvfRabitQIndex(metricType MetricType, nlist int) *ivfRabitQIndex **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfSQ8Index.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfSQ8Index.md index f32f5376ad..38b39739ea 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfSQ8Index.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewIvfSQ8Index.md @@ -8,7 +8,7 @@ func NewIvfSQ8Index(metricType MetricType, nlist int) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -18,7 +18,7 @@ func NewIvfSQ8Index(metricType MetricType, nlist int) Index **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewJSONPathIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewJSONPathIndex.md index 608730dbee..fa5586eedd 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewJSONPathIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewJSONPathIndex.md @@ -8,7 +8,7 @@ func NewJSONPathIndex(indexType IndexType, jsonCastType string, jsonPath string) **PARAMETERS:** -- **indexType** (*[IndexType](../IndexType.md)*) +- **[indexType](../IndexType.md)** (*[IndexType](../IndexType.md)*) The index algorithm type to use. @@ -22,7 +22,7 @@ func NewJSONPathIndex(indexType IndexType, jsonCastType string, jsonPath string) **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewMinHashLSHIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewMinHashLSHIndex.md index 60915cf719..d2c6aa2d28 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewMinHashLSHIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewMinHashLSHIndex.md @@ -8,7 +8,7 @@ func NewMinHashLSHIndex(metricType entity.MetricType, lshBand int) *minhashLSHIn **PARAMETERS:** -- **metricType** (*[entity.MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[entity.MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -18,7 +18,7 @@ func NewMinHashLSHIndex(metricType entity.MetricType, lshBand int) *minhashLSHIn **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSCANNIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSCANNIndex.md index aafe1981d2..09b95b9b0d 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSCANNIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSCANNIndex.md @@ -8,7 +8,7 @@ func NewSCANNIndex(metricType MetricType, nlist int, withRawData bool) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -22,7 +22,7 @@ func NewSCANNIndex(metricType MetricType, nlist int, withRawData bool) Index **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSparseInvertedIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSparseInvertedIndex.md index 63a4e54210..a596f11b47 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSparseInvertedIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSparseInvertedIndex.md @@ -8,7 +8,7 @@ func NewSparseInvertedIndex(metricType MetricType, dropRatio float64) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -18,7 +18,7 @@ func NewSparseInvertedIndex(metricType MetricType, dropRatio float64) Index **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSparseWANDIndex.md b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSparseWANDIndex.md index 6a4db2a5b3..a4ce6b1d8e 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSparseWANDIndex.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Management/Index/NewSparseWANDIndex.md @@ -8,7 +8,7 @@ func NewSparseWANDIndex(metricType MetricType, dropRatio float64) Index **PARAMETERS:** -- **metricType** (*[MetricType](../MetricType.md)*) +- **[metricType](../MetricType.md)** (*[MetricType](../MetricType.md)*) The distance metric type for similarity search (e.g., index.COSINE, index.L2, index.IP). @@ -18,7 +18,7 @@ func NewSparseWANDIndex(metricType MetricType, dropRatio float64) Index **RETURNS:** -*Index* +*[Index](Index.md)* An index configuration instance. Pass this to `CreateIndex()` via the index option. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/ResourceGroup/UpdateResourceGroup.md b/API_Reference/milvus-sdk-go/v2.6.x/ResourceGroup/UpdateResourceGroup.md index d38139b45b..e55001ca9b 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/ResourceGroup/UpdateResourceGroup.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/ResourceGroup/UpdateResourceGroup.md @@ -20,7 +20,7 @@ err := client.UpdateResourceGroup(ctx, option) The name of the resource group. -- **resourceGroupConfig** (**[entity.ResourceGroupConfig](ResourceGroupConfig.md)*) +- **[resourceGroupConfig](ResourceGroupConfig.md)** (**[entity.ResourceGroupConfig](ResourceGroupConfig.md)*) The resource group config. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewAutoAnnParam.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewAutoAnnParam.md index 7395589f31..50f8a19957 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewAutoAnnParam.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewAutoAnnParam.md @@ -14,7 +14,7 @@ func NewAutoAnnParam(level int) autoAnnParam **RETURNS:** -*AnnParam* +*[AnnParam](AnnParam.md)* An ANN search parameter instance. Pass this to a search option via `WithAnnParam()`. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewCustomAnnParam.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewCustomAnnParam.md index f157f0488a..a3eb9d8cf8 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewCustomAnnParam.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewCustomAnnParam.md @@ -8,7 +8,7 @@ func NewCustomAnnParam() CustomAnnParam **RETURNS:** -*AnnParam* +*[AnnParam](AnnParam.md)* An ANN search parameter instance. Pass this to a search option via `WithAnnParam()`. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewDiskAnnParam.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewDiskAnnParam.md index 6a4aba802e..7b62733ffc 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewDiskAnnParam.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewDiskAnnParam.md @@ -14,7 +14,7 @@ func NewDiskAnnParam(searchList int) diskANNParam **RETURNS:** -*AnnParam* +*[AnnParam](AnnParam.md)* An ANN search parameter instance. Pass this to a search option via `WithAnnParam()`. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewHNSWAnnParam.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewHNSWAnnParam.md index d3f04d5cd8..26f4a8bf4a 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewHNSWAnnParam.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewHNSWAnnParam.md @@ -14,7 +14,7 @@ func NewHNSWAnnParam(ef int) hsnwAnnParam **RETURNS:** -*AnnParam* +*[AnnParam](AnnParam.md)* An ANN search parameter instance. Pass this to a search option via `WithAnnParam()`. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewIvfAnnParam.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewIvfAnnParam.md index c426991c00..f7e577dfd3 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewIvfAnnParam.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewIvfAnnParam.md @@ -14,7 +14,7 @@ func NewIvfAnnParam(nprobe int) ivfAnnParam **RETURNS:** -*AnnParam* +*[AnnParam](AnnParam.md)* An ANN search parameter instance. Pass this to a search option via `WithAnnParam()`. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewIvfRabitQAnnParam.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewIvfRabitQAnnParam.md index 9d97f56423..9b513943e9 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewIvfRabitQAnnParam.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewIvfRabitQAnnParam.md @@ -14,7 +14,7 @@ func NewIvfRabitQAnnParam(nprobe int) *ivfRabitQAnnParam **RETURNS:** -*AnnParam* +*[AnnParam](AnnParam.md)* An ANN search parameter instance. Pass this to a search option via `WithAnnParam()`. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewMinHashLSHAnnParam.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewMinHashLSHAnnParam.md index 3286d6fa32..d676a944a7 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewMinHashLSHAnnParam.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewMinHashLSHAnnParam.md @@ -8,7 +8,7 @@ func NewMinHashLSHAnnParam() *minHashLSHAnnParam **RETURNS:** -*AnnParam* +*[AnnParam](AnnParam.md)* An ANN search parameter instance. Pass this to a search option via `WithAnnParam()`. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewSCANNAnnParam.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewSCANNAnnParam.md index e0fe34b1e1..2bb12d37ab 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewSCANNAnnParam.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewSCANNAnnParam.md @@ -18,7 +18,7 @@ func NewSCANNAnnParam(nprobe int, reorderK int) scannAnnParam **RETURNS:** -*AnnParam* +*[AnnParam](AnnParam.md)* An ANN search parameter instance. Pass this to a search option via `WithAnnParam()`. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewSparseAnnParam.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewSparseAnnParam.md index ce7eba58b9..b4729a4e8a 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewSparseAnnParam.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/AnnParam/NewSparseAnnParam.md @@ -8,7 +8,7 @@ func NewSparseAnnParam() sparseAnnParam **RETURNS:** -*AnnParam* +*[AnnParam](AnnParam.md)* An ANN search parameter instance. Pass this to a search option via `WithAnnParam()`. diff --git a/API_Reference/milvus-sdk-go/v2.6.x/Vector/QueryIterator.md b/API_Reference/milvus-sdk-go/v2.6.x/Vector/QueryIterator.md index 3c4a70b5d5..6fd0962181 100644 --- a/API_Reference/milvus-sdk-go/v2.6.x/Vector/QueryIterator.md +++ b/API_Reference/milvus-sdk-go/v2.6.x/Vector/QueryIterator.md @@ -1,6 +1,6 @@ # QueryIterator() -This operation creates an iterator for paginating through large query result sets. +This operation creates a query iterator that retrieves matching entities from a collection in batches. Use this for large result sets that should not be loaded into memory all at once. ```go func (c *Client) QueryIterator(ctx context.Context, option QueryIteratorOption, callOptions ...grpc.CallOption) (QueryIterator, error) @@ -9,105 +9,97 @@ func (c *Client) QueryIterator(ctx context.Context, option QueryIteratorOption, ## Request Syntax ```go -option := milvusclient.NewQueryIteratorOption(collectionName). +client.QueryIterator(ctx, milvusclient.NewQueryIteratorOption(collectionName). WithBatchSize(batchSize). - WithPartitions(partitionNames). + WithPartitions(partitionNames...). WithFilter(expr). - WithOutputFields(fieldNames). + WithOutputFields(fieldNames...). WithConsistencyLevel(consistencyLevel). - WithIteratorLimit(limit) - -result, err := client.QueryIterator(ctx, option) + WithIteratorLimit(limit), +) ``` -**PARAMETERS:** - -- **collectionName** (*string*) - - The name of the target collection. - **OPTION METHODS:** -- `WithBatchSize(batchSize int)` +- `NewQueryIteratorOption(collectionName string)` - - Sets the number of entities to fetch per iteration batch. + **[REQUIRED]** -- `WithPartitions(partitionNames ...string)` + Creates a new query iterator option for the specified collection. - Limits the operation to the specified partitions. +- `WithBatchSize(batchSize int)` - -- `WithFilter(expr string)` + The number of entities to return per iteration batch. Default: `1000`. - Applies a boolean filter expression to narrow results. +- `WithPartitions(partitionNames ...string)` - -- `WithOutputFields(fieldNames ...string)` + The partitions to query. If not specified, all partitions are queried. - Specifies which fields to include in the returned results. +- `WithFilter(expr string)` - -- `WithConsistencyLevel(consistencyLevel [entity.ConsistencyLevel](../Collection/ConsistencyLevel.md))` + A boolean expression to filter entities. Only entities matching the expression are returned. - Sets the consistency level for the operation (Strong, Bounded, Session, or Eventually). +- `WithOutputFields(fieldNames ...string)` - -- `WithIteratorLimit(limit int64)` + The fields to include in the returned entities. If not specified, only the primary key field is returned. - WithIteratorLimit sets the limit of entries to iterate if limit < 0, then it will be set to Unlimited +- `WithConsistencyLevel(consistencyLevel entity.ConsistencyLevel)` - -**RETURN TYPE:** + The consistency level for the query. Default: `Bounded`. -*[QueryIterator](QueryIterator.md), error* +- `WithIteratorLimit(limit int64)` - + + The maximum total number of entities to iterate over. A negative value means unlimited. Default: `Unlimited` (-1). **RETURNS:** -A QueryIterator for paginating through query results. Returns an error if the operation fails. +*QueryIterator, error* -**EXCEPTIONS:** +The QueryIterator interface provides paginated access to query results. Call `Next()` repeatedly until `io.EOF` is returned. -- **error** +**EXCEPTIONS:** - Check `err != nil` for failure details. +- **error** - The specified collection does not exist, invalid parameters, or the server is unreachable. ## Example ```go import ( - "context" - "fmt" - "io" + "context" + "fmt" + "io" - "github.com/milvus-io/milvus/client/v2/milvusclient" + "github.com/milvus-io/milvus/client/v2/milvusclient" ) -ctx, cancel := context.WithCancel(context.Background()) -defer cancel() - -milvusAddr := "127.0.0.1:19530" +ctx := context.Background() -cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{ - Address: milvusAddr, -}) -if err != nil { - // handle error -} - -defer cli.Close(ctx) - -iter, err := cli.QueryIterator(ctx, milvusclient.NewQueryIteratorOption("quick_setup"). - WithFilter("color like "red%""). - WithOutputFields("id", "color")) +iter, err := client.QueryIterator(ctx, + milvusclient.NewQueryIteratorOption("my_collection"). + WithBatchSize(500). + WithFilter("age > 18"). + WithOutputFields("name", "age"), +) if err != nil { - // handle error + log.Fatal(err) } for { - resultSet, err := iter.Next(ctx) - if err == io.EOF { - break - } - if err != nil { - // handle error - } - for i := 0; i < resultSet.Len(); i++ { - fmt.Println(resultSet.IDs) - } + rs, err := iter.Next(ctx) + if err == io.EOF { + break + } + if err != nil { + log.Fatal(err) + } + fmt.Printf("Got %d results\n", rs.Len()) } ``` + +## QueryIterator + +The QueryIterator interface returned by the `QueryIterator()` method. It has a single method: + +- `Next(ctx context.Context)` - + + Returns the next batch of query results as a `ResultSet`. When all results have been consumed, returns `io.EOF` as the error. \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/DataType.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/DataType.md index 67de9fd5ec..99bb15b063 100644 --- a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/DataType.md +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/DataType.md @@ -74,7 +74,7 @@ This is an enumeration that provides the following constants. - SparseFloatVector(104) - Sets the data type to **Sparse Vector**. +Sets the data type to **Sparse Vector**. - Inv8Vector(105) diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/BoostRanker.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/BoostRanker.md index f564a468f5..312e9873e0 100644 --- a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/BoostRanker.md +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/BoostRanker.md @@ -77,7 +77,7 @@ BoostRanker.builder() **RETURNS:** - A boost ranker instance. +A boost ranker instance. ## Examples: diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/DecayRanker.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/DecayRanker.md index bfaba782ee..2a6daa44a0 100644 --- a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/DecayRanker.md +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/DecayRanker.md @@ -79,7 +79,7 @@ DecayRanker.builder() **RETURNS:** - A decay ranker instance. +A decay ranker instance. ## Examples: diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/ModelRanker.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/ModelRanker.md index cf742e888b..00d4865cfb 100644 --- a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/ModelRanker.md +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/ModelRanker.md @@ -60,7 +60,7 @@ ModelRanker.builder() **RETURNS:** - A model ranker instance. +A model ranker instance. ## Examples: diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/RRFRanker.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/RRFRanker.md index e5a4543f8f..453cfb2dba 100644 --- a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/RRFRanker.md +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/RRFRanker.md @@ -41,7 +41,7 @@ RRFRanker.builder() **RETURNS:** - A RRF ranker instance. +A RRF ranker instance. ## Examples: diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/WeightedRanker.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/WeightedRanker.md index 4fb807bfb2..2c70ae64dc 100644 --- a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/WeightedRanker.md +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/Function/WeightedRanker.md @@ -42,7 +42,7 @@ WeightedRanker.builder() **RETURNS:** - A weighted ranker instance. +A weighted ranker instance. ## Examples: diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/createSchema.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/createSchema.md new file mode 100644 index 0000000000..44fc6b8591 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/createSchema.md @@ -0,0 +1,48 @@ +# createSchema() + +This operation creates a collection schema. + +```java +public CreateCollectionReq.CollectionSchema createSchema() +``` + +## Request Syntax + +```java +MilvusClientV2.createSchema() +``` + +**PARAMETERS:** + +None + +**RETURN TYPE:** + +*CreateCollectionReq.CollectionSchema* + +**RETURNS:** + +A **CreateCollectionReq.CollectionSchema** object. + +## Example + +```java +import io.milvus.v2.client.ConnectConfig; +import io.milvus.v2.client.MilvusClientV2; +import io.milvus.v2.common.DataType; +import io.milvus.v2.service.collection.request.AddFieldReq; +import io.milvus.v2.service.collection.request.CreateCollectionReq; + +// 1. Set up a client +ConnectConfig connectConfig = ConnectConfig.builder() + .uri("http://localhost:19530") + .token("root:Milvus") + .build(); + +MilvusClientV2 client = new MilvusClientV2(connectConfig); + +// 2 Quickly create a collectionSchema +CreateCollectionReq.CollectionSchema collectionSchema = client.createSchema(); +collectionSchema.addField(AddFieldReq.builder().fieldName("id").dataType(DataType.Int64).isPrimaryKey(Boolean.TRUE).autoID(Boolean.FALSE).description("id").build()); +collectionSchema.addField(AddFieldReq.builder().fieldName("vector").dataType(DataType.FloatVector).dimension(dim).build()); +``` diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/truncateCollection.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/truncateCollection.md new file mode 100644 index 0000000000..b927225572 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/Collections/truncateCollection.md @@ -0,0 +1,48 @@ +# truncateCollection() + +This operation removes all data from a collection while preserving the collection schema, indexes, and aliases. + +```java +client.truncateCollection(TruncateCollectionReq request) +``` + +## Request Syntax + +```java +TruncateCollectionReq.builder() + .collectionName(String collectionName) + .databaseName(String databaseName) + .build() +``` + +**BUILDER METHODS:** + +- `collectionName(String collectionName)` - + + **[REQUIRED]** + + The name of the collection to truncate. + +- `databaseName(String databaseName)` - + + The name of the database containing the collection. If not specified, the default database is used. + +**RETURNS:** + +*void* + +**EXCEPTIONS:** + +- **MilvusClientException** - The specified collection does not exist or the server is unreachable. + +## Example + +```java +import io.milvus.v2.service.collection.request.TruncateCollectionReq; + +TruncateCollectionReq req = TruncateCollectionReq.builder() + .collectionName("my_collection") + .build(); + +client.truncateCollection(req); +``` diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/BulkImport/BulkImport.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/BulkImport/BulkImport.md new file mode 100644 index 0000000000..6abd8e1d59 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/BulkImport/BulkImport.md @@ -0,0 +1,12 @@ +# BulkImport + +A **BulkImport** instance provides methods for you to manipulate data import jobs. + +```java +io.milvus.bulkwriter.BulkImport +``` + +## Constructor + +*None* + diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/LocalBulkWriter/appendRow.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/LocalBulkWriter/appendRow.md index 23a43f9ef3..71aa03336b 100644 --- a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/LocalBulkWriter/appendRow.md +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/LocalBulkWriter/appendRow.md @@ -18,6 +18,14 @@ public void appendRow(JsonObject rowData) throws IOException, InterruptedExcepti **EXCEPTIONS:** +- **IOException** + + This is a checked exception thrown when any data-read or data-write errors occur during this operation. + +- **InterruptedException** + + This is a checked exception thrown when a thread that is currently "blocking" (waiting, sleeping, or otherwise occupied) is interrupted by another thread using the `Thread.interrupt()` method. + - **MilvusClientException** This exception will be raised when any error occurs during this operation. diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/VolumeBulkWriter.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/VolumeBulkWriter.md new file mode 100644 index 0000000000..e6188d7ff4 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/VolumeBulkWriter.md @@ -0,0 +1,139 @@ +# VolumeBulkWriter + +A **VolumeBulkWriter** instance rewrites your raw data to a Zilliz Cloud Volume in a format that Milvus understands. + +```java +io.milvus.bulkwriter.VolumeBulkWriter +``` + +## Constructor + +Constructs a **VolumeBulkWriter** instance by schema, output path, segment size, and file type. + +
+ +A **VolumeBulkWriter** object intends to rewrite your raw data to a Zilliz Cloud Volume in a format that Milvus understands. + +
+ +```java +VolumeBulkWriter(VolumeBulkWriterParam bulkWriterParam) +``` + +**PARAMETERS:** + +- **bulkWriterParam** (*VolumeBulkWriterParam*) - + + A [VolumeBulkWriterParam](VolumeBulkWriter.md) instance. + +## VolumeBulkWriterParam + +**VolumeBulkWriterParam** allows you to configure properties for your **VolumeBulkWriter** instances in one place so that you can instantiate the **VolumeBulkWriter** class. + +```java +VolumeBulkWriterParam.newBuilder() + .withCollectionSchema(CreateCollectionReq.CollectionSchema collectionSchema) + .withLocalPath(String localPath) + .withChunkSize(long chunkSize) + .withFileType(BulkFileType fileType) + .withConfig(String key, Object val) + .withCloudEndpoint(string cloudEndpoint) + .withApiKey(string apiKey) + .withVolumeName(string volumeName) + .build() +``` + +**BUILDER METHODS:** + +- `withCollectionSchema(CreateCollectionReq.CollectionSchema collectionSchema)` + + The schema of the target collection that is defined by instantiating **CreateCollectionReq.CollectionSchema**. + +- `withLocalPath(String localPath)` + + The path to the directory that is to hold the rewritten data. + +- `withChunkSize(long chunkSize)` + + The maximum size of a file segment. While rewriting your raw data, Milvus splits it into segments. + + The value defaults to **536,870,912** in bytes, which is **512 MB**. + +
+ + The way BulkWriter segments your data varies with the target file type. + + If the generated file exceeds the specified segment size, BulkWriter creates multiple files and names them in sequence numbers, each no larger than the segment size. + +
+ +- `withFileType(BulkFileType fileType)` + + The type of the output file. Possible options are listed in [BulkFileType](../BulkFileType.md). + +- `withConfig(String key, Object val)` + + A dictionary specifying optional configurations for processing CSV files. This parameter applies only when you set `fileType` to `CSV` in `withFileType()`. The dictionary contains the following fields: + + - **sep** (*string*) - + + The delimiter of CSV file. The value must be a string of length 1, which defaults to `","`. The following strings are not allowed: `"\0"`, `"\n"`, `"\r"`, `"""`. + + - **nullkey** (*string*) - + + Special string representing null value. The value defaults to empty string: `""`. + +- `withCloudEndpoint(string cloudEndpoint)` + + The Zilliz Cloud public endpoint is always `https:*//*api.cloud.zilliz.com`. + +- `withApiKey(string apiKey)` + + A valid Zilliz Cloud API key with sufficient permissions to operate resources related to this operation. + +- `withVolumeName(string volumeName)` + + A valid volume name. Ensure that the volume by the specified name exists. + +## Example + +```java +import com.google.gson.JsonObject; +import io.milvus.bulkwriter.VolumeBulkWriter; +import io.milvus.bulkwriter.VolumeBulkWriterParam; +import io.milvus.bulkwriter.common.clientenum.BulkFileType; +import io.milvus.v2.service.collection.request.CreateCollectionReq; + +private static void volumeWriter(CreateCollectionReq.CollectionSchema collectionSchema) throws Exception { + VolumeBulkWriterParam bulkWriterParam = VolumeBulkWriterParam.newBuilder() + .withCollectionSchema(collectionSchema) + .withLocalPath("/tmp/bulk_writer") + .withFileType(BulkFileType.PARQUET) + .withChunkSize(128 * 1024 * 1024) + .withCloudEndpoint("https://api.cloud.zilliz.com") + .withApiKey("YOUR_API_KEY") + .withVolumeName("my_volume") + .build(); + + try (VolumeBulkWriter volumeBulkWriter = new VolumeBulkWriter(bulkWriterParam)) { + // append rows + Gson GSON_INSTANCE = new Gson(); + for (int i = 0; i < 10000; i++) { + JsonObject row = new JsonObject(); + row.addProperty("path", "path_" + i); + row.add("vector", GSON_INSTANCE.toJsonTree(GeneratorUtils.genFloatVector(DIM))); + row.addProperty("label", "label_" + i); + + volumeBulkWriter.appendRow(row); + } + + volumeBulkWriter.commit(false); + List> batchFiles = volumeBulkWriter.getBatchFiles(); + System.out.printf("Volume writer done! output local files: %s%n", batchFiles); + } catch (Exception e) { + System.out.println("Local writer catch exception: " + e); + throw e; + } +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/appendRow.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/appendRow.md new file mode 100644 index 0000000000..7fe2780449 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/appendRow.md @@ -0,0 +1,42 @@ +# appendRow() + +This operation appends a row of data to the VolumeBulkWriter buffer. The data will be written to a file when the buffer is full or when `commit()` is called. + +```java +public void appendRow(JsonObject rowData) throws IOException, InterruptedException +``` + +**PARAMETERS:** + +- **rowData** (*JsonObject*) - + + A JSON object representing a single row of data. + +**RETURNS:** + +*void* + +**EXCEPTIONS:** + +- **IOException** + + This is a checked exception thrown when any data-read or data-write errors occur during this operation. + +- **InterruptedException** + + This is a checked exception thrown when a thread that is currently "blocking" (waiting, sleeping, or otherwise occupied) is interrupted by another thread using the `Thread.interrupt()` method. + +- **MilvusClientException** + + This exception will be raised when any error occurs during this operation. + +## Example + +```java +VolumeBulkWriter writer = new VolumeBulkWriter(config); +JsonObject row = new JsonObject(); +row.addProperty("id", 1L); +row.add("vector", gson.toJsonTree(new float[]{0.1f, 0.2f, 0.3f})); +writer.appendRow(row); +``` + diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/close.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/close.md new file mode 100644 index 0000000000..fb9e0b37d0 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/close.md @@ -0,0 +1,28 @@ +# close() + +This operation closes the current VolumeBulkWriter instance. + +```java +public void close() +``` + +## Request Syntax + +```java +volumeBulkWriter.close() +``` + +**PARAMETERS:** + +*None* + +**RETURNS TYPE:** + +*void* + +## Example + +```java +volumeBulkWriter.close() +``` + diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/commit.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/commit.md new file mode 100644 index 0000000000..bc21478b96 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/commit.md @@ -0,0 +1,32 @@ +# commit() + +This operation commits the appended data. + +```java + public void commit(boolean async) +``` + +## Request Syntax + +```java +volumeBulkWriter.commit( + boolean async +) +``` + +**PARAMETERS:** + +- **async** (*boolean*) - + + Whether the commit operation returns immediately after being called. + +**RETURN TYPE:** + +*void* + +## Examples + +```java +volumeBulkWriter.commit(false); +``` + diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getBatchFiles.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getBatchFiles.md new file mode 100644 index 0000000000..f73d9c2b5a --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getBatchFiles.md @@ -0,0 +1,28 @@ +# getBatchFiles() + +This operation returns a list of files passed to the current VolumeBulkWriter instance. + +```java +public List> getBatchFiles() +``` + +## Request Syntax + +```java +volumeBulkWriter.getBatchFiles() +``` + +**PARAMETERS:** + +*None* + +**RETURNS TYPE:** + +*List\>* + +## Example + +```java +List> batchFiles = volumeBulkWriter.getBatchFiles(); +``` + diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getTotalRowCount.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getTotalRowCount.md new file mode 100644 index 0000000000..9cbdde5c3f --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getTotalRowCount.md @@ -0,0 +1,27 @@ +# getTotalRowCount() + +This operation returns the total number of rows written by this VolumeBulkWriter instance. + +```java +public Long getTotalRowCount() +``` + +**RETURNS:** + +*Long* + +**EXCEPTIONS:** + +- **MilvusClientException** + + This exception will be raised when any error occurs during this operation. + +## Example + +```java +VolumeBulkWriter writer = new VolumeBulkWriter(config); +// ... append rows +Long totalRows = writer.getTotalRowCount(); +System.out.println("Total rows written: " + totalRows); +``` + diff --git a/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getVolumeUploadResult.md b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getVolumeUploadResult.md new file mode 100644 index 0000000000..95ee4a515d --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.6.x/v2/DataImport/VolumeBulkWriter/getVolumeUploadResult.md @@ -0,0 +1,51 @@ +# getVolumeUploadResult() + +This operation retrieves the result of the update to the specified volume. + +```java +public UploadFilesResult getVolumeUploadResult() +``` + +**PARAMETERS:** + +*None* + +**RETURN TYPE:** + +*UploadFilesResult* + +**RETURNS:** + +An UploadFilesResult instance that has the following methods: + +- `getVolumeName()` + + Returns the name of the target volume. + +- `setVolumeName()` + + Sets the name of the target volume. + +- `getPath()` + + Returns the path of the uploaded file to the target volume. + +- `setPath()` + + Sets the path of the uploaded file to the target volume. + +- `toString()` + + Strigifies the UploadFilesResult instance. + +## Example + +```java +VolumeBulkWriter writer = new VolumeBulkWriter(config); +// ... append rows +UploadFilesResult result = writer.getVolumeUploadResult(); + +System.out.println("Target volume: " + result.getVolumeName()); +System.out.println("Target paths: " + result.getPath()); +``` + diff --git a/API_Reference/milvus-sdk-node/v2.6.x/Collections/getPkFieldType.md b/API_Reference/milvus-sdk-node/v2.6.x/Collections/getPkFieldType.md index 5993c84a4c..61b12f7b3c 100644 --- a/API_Reference/milvus-sdk-node/v2.6.x/Collections/getPkFieldType.md +++ b/API_Reference/milvus-sdk-node/v2.6.x/Collections/getPkFieldType.md @@ -47,3 +47,4 @@ const pkType = await client.getPkFieldType({ }); console.log(pkType); // e.g., "Int64" ``` + diff --git a/API_Reference/milvus-sdk-node/v2.6.x/Collections/truncateCollection.md b/API_Reference/milvus-sdk-node/v2.6.x/Collections/truncateCollection.md new file mode 100644 index 0000000000..17e056c8bc --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.6.x/Collections/truncateCollection.md @@ -0,0 +1,103 @@ +# truncateCollection() + +This operation removes all data from a collection but retains the collection schema and structure. + +```javascript +await milvusClient.truncateCollection(data: TruncateCollectionRequest) +``` + +
+ +- **Irreversible operation** + +Truncating a collection permanently removes all data. + +- **Schema preserved** + +The collection structure, fields, indexes, and properties remain intact. + +
+ +## Request Syntax + +```javascript +truncateCollection({ + db_name?: string, + collection_name: string, + timeout?: number +}) +``` + +**PARAMETERS:** + +- **db_name** (*string*) - + + The name of the database containing the collection. + +- **collection_name** (*string*) - + + **[REQUIRED]** + + The name of the target collection. + +- **timeout** (*number*) - + + RPC timeout in milliseconds. + +**RETURNS:** + +*Promise\* + +This method returns a promise that resolves to a **ResStatus** object. + +```javascript +{ + code: number, + error_code: string | number, + reason: string +} +``` + +**PARAMETERS:** + +- **code** (*number*) - + + A code that indicates the operation result. It remains **0** if this operation succeeds. + +- **error_code** (*string* | *number*) - + + An error code that indicates an occurred error. It remains **Success** if this operation succeeds. + +- **reason** (*string*) - + + The reason that indicates the reason for the reported error. It remains an empty string if this operation succeeds. + +## Example + +### Basic usage + +```javascript +import { MilvusClient } from '@zilliz/milvus2-sdk-node'; + +const milvusClient = new MilvusClient({ + address: 'localhost:19530', + token: 'root:Milvus', +}); + +// Truncate collection +const res = await milvusClient.truncateCollection({ + collection_name: 'my_collection', +}); + +console.log(res); +// Output: { error_code: 'Success', reason: '' } +``` + +### With database specified + +```javascript +const res = await milvusClient.truncateCollection({ + db_name: 'my_database', + collection_name: 'my_collection', +}); +``` diff --git a/API_Reference/pymilvus/v2.6.x/MilvusClient/Collections/DataType.md b/API_Reference/pymilvus/v2.6.x/MilvusClient/Collections/DataType.md index bbad9f9584..40486dfae8 100644 --- a/API_Reference/pymilvus/v2.6.x/MilvusClient/Collections/DataType.md +++ b/API_Reference/pymilvus/v2.6.x/MilvusClient/Collections/DataType.md @@ -48,6 +48,10 @@ This is an enumeration that provides the following constants. Sets the datatype to **Geometry**. +- TIMESTAMPTZ + + Sets the datatype to **TIMESTAMPTZ**. + - STRUCT Sets the data type of the elements in an Array field to **Struct**.