Skip to content

Commit

Permalink
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 8a1003d commit 9b1c3fe
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/es_archiver/lib/indices/create_index_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ export function createCreateIndexStream({ client, stats, skipExisting, log }) {

async function handleIndex(record) {
const { index, settings, mappings, aliases } = record.value;

// Determine if the mapping belongs to a pre-7.0 instance, for BWC tests, mainly
const isPre7Mapping = !!mappings && Object.keys(mappings).length > 0 && !mappings.properties;
const isKibana = index.startsWith('.kibana');

async function attemptToCreate(attemptNumber = 1) {
Expand All @@ -52,21 +49,15 @@ export function createCreateIndexStream({ client, stats, skipExisting, log }) {
await deleteKibanaIndicesOnce({ client, stats, log });
}

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

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

await client.indices.create(createArgs);
});

stats.createdIndex(index, { settings });
} catch (err) {
Expand Down

0 comments on commit 9b1c3fe

Please sign in to comment.