-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add es:migrate command #81
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 🎉
Also can you provide examples of the command with the public static examples = []
please?
src/commands/es/migrate.ts
Outdated
static flags = { | ||
help: flags.help(), | ||
src: flags.string({ | ||
description: 'Source Elasticsearch server URL (', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: 'Source Elasticsearch server URL (', | |
description: 'Source Elasticsearch server URL', |
src/commands/es/migrate.ts
Outdated
default: false, | ||
}), | ||
limit: flags.integer({ | ||
description: 'Document transfer limit', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description in unclear to me, what kind of limit are we talking about?
src/commands/es/migrate.ts
Outdated
description: 'Document transfer limit', | ||
default: 1000, | ||
}), | ||
force: flags.boolean({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking: maybe --no-interactive like APT is more understandable?
src/commands/es/migrate.ts
Outdated
private async migrateData(index: string, limit: number) { | ||
const queue = [] | ||
// Quick scroll duration estimation based on number of documents per hit | ||
const scrollDuration = 5 * (limit % 1000) > 0 ? `${5 * (limit % 1000)}s` : '5s' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the purpose of this line since the value of scrollDuration
wont grow linearly with the value of limit
.
On the opposite, a small limit
like 103
will give me 515s
of scrollDuration
# [0.18.0](https://github.com/kuzzleio/kourou/releases/tag/0.18.0) (2021-02-08) #### New features - [ [#82](#82) ] Add an option to export data in a format compatible with Kuzzle fixtures ([jenow](https://github.com/jenow)) - [ [#81](#81) ] Add es:migrate command ([alexandrebouthinon](https://github.com/alexandrebouthinon)) #### Enhancements - [ [#93](#93) ] Update app template ([Aschen](https://github.com/Aschen)) - [ [#92](#92) ] Add yaml support for vault ([Aschen](https://github.com/Aschen)) #### Others - [ [#77](#77) ] Add Quine example ([Aschen](https://github.com/Aschen)) ---
What does this PR do?
Add a new command to the
es
module to migrate data and mappings from an Elasticsearch server to another using bulk API: