diff --git a/README.md b/README.md index 1e9ae3c4..c5302b14 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ node scripts/update_settings.js # update index settings #### output schema file -Use this script to pretty-print the whole schema file or a single mapping to stdout. +Use this script to pretty-print the whole schema's mappings to stdout. ```bash node scripts/output_mapping.js diff --git a/scripts/list_analyzers.js b/scripts/list_analyzers.js index ee386f56..69117e82 100644 --- a/scripts/list_analyzers.js +++ b/scripts/list_analyzers.js @@ -54,7 +54,7 @@ const error = function(vals) { } // parse mapping -const mapping = schema.mappings[config.schema.typeName]; +const mapping = schema.mappings; const dynamic = mapping.dynamic_templates.map(t => _.first(_.map(t, v => v))); // process and single mapping property (recursively) diff --git a/scripts/output_mapping.js b/scripts/output_mapping.js index fecad4c4..23db63f4 100644 --- a/scripts/output_mapping.js +++ b/scripts/output_mapping.js @@ -3,19 +3,5 @@ var es = require('@elastic/elasticsearch'); var client = new es.Client(config.esclient); var schema = require('../schema'); -var _index = ( process.argv.length > 3 ) ? process.argv[3] : config.schema.indexName; -var _type = ( process.argv.length > 2 ) ? process.argv[2] : null; // get type from cli args - -// print out mapping for just one type -if ( _type ) { - var mapping = schema.mappings[_type]; - if( !mapping ){ - console.error( 'could not find a mapping in the schema file for', _index+'/'+_type ); - process.exit(1); - } - console.log( JSON.stringify( mapping, null, 2 ) ); -//print out the entire schema mapping -} else { - console.log( JSON.stringify( schema, null, 2 ) ); -} +console.log( JSON.stringify( schema.mappings, null, 2 ) );