Skip to content

Commit c5f33d9

Browse files
authored
chore: Move --ensure-payload-indexes from common migration options (#54)
Signed-off-by: Anush008 <[email protected]>
1 parent 0ec2435 commit c5f33d9

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,12 @@ NOTE: If the target collection already exists, its vector size and dimensions mu
356356
357357
#### Target Qdrant Options
358358
359-
| Flag | Description |
360-
| --------------------- | ---------------------------------------------------------- |
361-
| `--target.collection` | Target collection name |
362-
| `--target.url` | Target gRPC URL. Default: `"http://localhost:6334"` |
363-
| `--target.api-key` | API key for target instance |
359+
| Flag | Description |
360+
| --------------------------------- | --------------------------------------------------- |
361+
| `--target.collection` | Target collection name |
362+
| `--target.url` | Target gRPC URL. Default: `"http://localhost:6334"` |
363+
| `--target.api-key` | API key for target instance |
364+
| `--target.ensure-payload-indexes` | Ensure payload indexes exist. Default: true |
364365
365366
See [Shared Migration Options](#shared-migration-options) for shared parameters.
366367
@@ -375,5 +376,4 @@ These options apply to all migrations, regardless of the source.
375376
| `--migration.batch-size` | Migration batch size. Default: 50 |
376377
| `--migration.restart` | Restart migration without resuming from offset. Default: false |
377378
| `--migration.create-collection` | Create the collection if it doesn't exist. Default: true |
378-
| `--migration.ensure-payload-indexes` | Ensure payload indexes exist. Default: true |
379-
| `--migration.offsets-collection` | Collection to store migration offset. Default: `"_migration_offsets"` |
379+
| `--migration.offsets-collection` | Collection to store migration offset. Default: `"_migration_offsets"`|

cmd/migrate_from_qdrant.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ import (
1515
)
1616

1717
type MigrateFromQdrantCmd struct {
18-
Source commons.QdrantConfig `embed:"" prefix:"source."`
19-
Target commons.QdrantConfig `embed:"" prefix:"target."`
20-
Migration commons.MigrationConfig `embed:"" prefix:"migration."`
18+
Source commons.QdrantConfig `embed:"" prefix:"source."`
19+
Target commons.QdrantConfig `embed:"" prefix:"target."`
20+
Migration commons.MigrationConfig `embed:"" prefix:"migration."`
21+
EnsurePayloadIndexes bool `help:"Ensure payload indexes are created" default:"true" prefix:"target."`
2122

2223
sourceHost string
2324
sourcePort int
@@ -158,7 +159,7 @@ func (r *MigrateFromQdrantCmd) perpareTargetCollection(ctx context.Context, sour
158159
return fmt.Errorf("failed to get target collection information: %w", err)
159160
}
160161

161-
if r.Migration.EnsurePayloadIndexes {
162+
if r.EnsurePayloadIndexes {
162163
for name, schemaInfo := range sourceCollectionInfo.GetPayloadSchema() {
163164
fieldType := getFieldType(schemaInfo.GetDataType())
164165
if fieldType == nil {

pkg/commons/config.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ type QdrantConfig struct {
77
}
88

99
type MigrationConfig struct {
10-
BatchSize int `short:"b" help:"Batch size" default:"50"`
11-
Restart bool `help:"Restart the migration and do not continue from last offset" default:"false"`
12-
CreateCollection bool `short:"c" help:"Create the collection if it does not exist" default:"true"`
13-
EnsurePayloadIndexes bool `help:"Ensure payload indexes are created" default:"true"`
14-
OffsetsCollection string `help:"Collection to store the current migration offset" default:"_migration_offsets"`
10+
BatchSize int `short:"b" help:"Batch size" default:"50"`
11+
Restart bool `help:"Restart the migration and do not continue from last offset" default:"false"`
12+
CreateCollection bool `short:"c" help:"Create the collection if it does not exist" default:"true"`
13+
OffsetsCollection string `help:"Collection to store the current migration offset" default:"_migration_offsets"`
1514
}
1615

1716
type MilvusConfig struct {

0 commit comments

Comments
 (0)