diff --git a/docs/api_methods.asciidoc b/docs/api_methods.asciidoc index f1e21fe4..bc7e24a4 100644 --- a/docs/api_methods.asciidoc +++ b/docs/api_methods.asciidoc @@ -3694,7 +3694,7 @@ client.indices.flushSynced([params, [callback]]) // no description -Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-flush.html#synced-flush-api[the elasticsearch docs] for more information pertaining to this method. +Check the *<>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-synced-flush-api.html[the elasticsearch docs] for more information pertaining to this method. // no examples @@ -3717,7 +3717,7 @@ Options::: `index`:: <>, <>, <> -- A comma-separated list of index names; use `_all` or empty string for all indices `body`:: -<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-flush.html#synced-flush-api[the elasticsearch docs] for details about what can be specified here. +<>, <> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-synced-flush-api.html[the elasticsearch docs] for details about what can be specified here. link:#[back to top] diff --git a/scripts/generate/js_api.js b/scripts/generate/js_api.js index 20a6f63e..f688bae3 100644 --- a/scripts/generate/js_api.js +++ b/scripts/generate/js_api.js @@ -188,9 +188,20 @@ module.exports = function(branch, done) { done(); } + var patchBadLinks = { + 'https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-flush.html#synced-flush-api': + 'https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-synced-flush-api.html', + }; + function writeMethodDocs(done) { var filename = fromRoot('docs/api_methods' + branchSuffix + '.asciidoc'); - fs.writeFile(filename, templates.apiMethods(docVars), function(err) { + var content = templates.apiMethods(docVars); + + for (const [bad, good] of Object.entries(patchBadLinks)) { + content = content.split(bad).join(good); + } + + fs.writeFile(filename, content, function(err) { if (!err) { console.log( chalk.white.bold('wrote'),