File tree Expand file tree Collapse file tree 3 files changed +3
-17
lines changed
Expand file tree Collapse file tree 3 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ node scripts/update_settings.js # update index settings
6464
6565#### output schema file
6666
67- Use this script to pretty-print the whole schema file or a single mapping to stdout.
67+ Use this script to pretty-print the whole schema's mappings to stdout.
6868
6969``` bash
7070node scripts/output_mapping.js
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ const error = function(vals) {
5454}
5555
5656// parse mapping
57- const mapping = schema . mappings [ config . schema . typeName ] ;
57+ const mapping = schema . mappings ;
5858const dynamic = mapping . dynamic_templates . map ( t => _ . first ( _ . map ( t , v => v ) ) ) ;
5959
6060// process and single mapping property (recursively)
Original file line number Diff line number Diff line change @@ -3,19 +3,5 @@ var es = require('@elastic/elasticsearch');
33var client = new es . Client ( config . esclient ) ;
44var schema = require ( '../schema' ) ;
55
6- var _index = ( process . argv . length > 3 ) ? process . argv [ 3 ] : config . schema . indexName ;
7- var _type = ( process . argv . length > 2 ) ? process . argv [ 2 ] : null ; // get type from cli args
8-
9- // print out mapping for just one type
10- if ( _type ) {
11- var mapping = schema . mappings [ _type ] ;
12- if ( ! mapping ) {
13- console . error ( 'could not find a mapping in the schema file for' , _index + '/' + _type ) ;
14- process . exit ( 1 ) ;
15- }
16- console . log ( JSON . stringify ( mapping , null , 2 ) ) ;
17- //print out the entire schema mapping
18- } else {
19- console . log ( JSON . stringify ( schema , null , 2 ) ) ;
20- }
6+ console . log ( JSON . stringify ( schema . mappings , null , 2 ) ) ;
217
You can’t perform that action at this time.
0 commit comments