-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "list_analyzers" and "output_mapping"
I think they've been broken since b6e92d4, which changed schema to have a single mapping. Presumably this was done as part of deprecating `doc._type`
- Loading branch information
1 parent
1e3ecd6
commit d43c9f0
Showing
3 changed files
with
3 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,4 @@ | ||
var config = require('pelias-config').generate(); | ||
var es = require('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 ) ); | ||
|