-
Notifications
You must be signed in to change notification settings - Fork 1
/
writeSolrIngestFiles.js
32 lines (29 loc) · 871 Bytes
/
writeSolrIngestFiles.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* Writes files for the Solr ingest. Generates two files. One that includes a list of all non-parent types in the NIEM dictionary. The second includes a list of all substitution group heads in the dictionary.
*/
'use strict';
const fs = require('fs');
const getNonparentTypes = require('./components/getNonparentTypes');
const getSubGroupHeaders = require('./components/getSubGroupHeaders');
getNonparentTypes()
.then(nonParentTypeIds => {
fs.writeFile('solrIngestData/nonparentTypes.json', JSON.stringify(nonParentTypeIds), err => {
if (err) {
console.log(err);
}
})
})
.catch(err => {
console.log(err);
});
getSubGroupHeaders()
.then(subGroupHeadIds => {
fs.writeFile('solrIngestData/subGroupHeaders.json', JSON.stringify(subGroupHeadIds), err => {
if (err) {
console.log(err);
}
})
})
.catch(err => {
console.log(err);
});