Skip to content

Commit

Permalink
deprecate include_type_name
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Nov 12, 2019
1 parent 0e3237e commit 8a1003d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ describe('esArchiver: createCreateIndexStream()', () => {
sinon.assert.calledWith(client.indices.create, {
method: 'PUT',
index: 'index',
include_type_name: false,
body: {
settings: undefined,
mappings: undefined,
Expand Down
11 changes: 8 additions & 3 deletions src/es_archiver/lib/indices/create_index_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,21 @@ export function createCreateIndexStream({ client, stats, skipExisting, log }) {
await deleteKibanaIndicesOnce({ client, stats, log });
}

await client.indices.create({
const createArgs = {
method: 'PUT',
index,
include_type_name: isPre7Mapping,
body: {
settings,
mappings,
aliases
},
});
};

if (isPre7Mapping) {
createArgs.include_type_name = isPre7Mapping;
}

await client.indices.create(createArgs);

stats.createdIndex(index, { settings });
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"indices.create": {
"url_params": {
"include_type_name": "__flag__",
"wait_for_active_shards": "",
"timeout": "",
"master_timeout": ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"indices.get": {
"url_params": {
"include_type_name": "__flag__",
"local": "__flag__",
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"indices.get_field_mapping": {
"url_params": {
"include_type_name": "__flag__",
"include_defaults": "__flag__",
"ignore_unavailable": "__flag__",
"allow_no_indices": "__flag__",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"indices.get_template": {
"url_params": {
"include_type_name": "__flag__",
"flat_settings": "__flag__",
"master_timeout": "",
"local": "__flag__"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"indices.put_template": {
"url_params": {
"include_type_name": "__flag__",
"order": "",
"create": "__flag__",
"timeout": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"indices.rollover": {
"url_params": {
"include_type_name": "__flag__",
"timeout": "",
"dry_run": "__flag__",
"master_timeout": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export const reindexActionsFactory = (

async getFlatSettings(indexName: string) {
const flatSettings = (await callCluster('transport.request', {
path: `/${encodeURIComponent(indexName)}?flat_settings=true&include_type_name=false`,
path: `/${encodeURIComponent(indexName)}?flat_settings=true`,
})) as { [indexName: string]: FlatSettings };

if (!flatSettings[indexName]) {
Expand Down

0 comments on commit 8a1003d

Please sign in to comment.