|
|
@ -83,12 +83,7 @@ function synthesizeDoc(results) { |
|
|
|
|
|
|
|
|
|
|
|
// assign the administrative hierarchy
|
|
|
|
// assign the administrative hierarchy
|
|
|
|
Object.keys(results).forEach((layer) => { |
|
|
|
Object.keys(results).forEach((layer) => { |
|
|
|
if (results[layer][0].hasOwnProperty('abbr')) { |
|
|
|
doc.addParent(layer, results[layer][0].name, results[layer][0].id.toString(), results[layer][0].abbr); |
|
|
|
doc.addParent(layer, results[layer][0].name, results[layer][0].id.toString(), results[layer][0].abbr); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
doc.addParent(layer, results[layer][0].name, results[layer][0].id.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const esDoc = doc.toESDocument(); |
|
|
|
const esDoc = doc.toESDocument(); |
|
|
|