feat: adjust to changes of SCFacet in core v0.12.0

Closes #30
This commit is contained in:
Sebastian Lange
2019-03-20 14:32:06 +01:00
committed by Rainer Killinger
parent 6f7e23df20
commit 2f13010480
3 changed files with 15 additions and 9 deletions

14
package-lock.json generated
View File

@@ -27,14 +27,15 @@
} }
}, },
"@openstapps/core": { "@openstapps/core": {
"version": "0.11.0", "version": "0.12.0",
"resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.11.0.tgz", "resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.12.0.tgz",
"integrity": "sha512-vCT09LVDRcSELK/F5RBe6IqXWow7kolkWMADXRIW5YqvAy/BpfUhta/v+YxFk/dp+umzMmCv9tRgZRxrznStGw==", "integrity": "sha512-msSsSQmZOzvcUbJZDZDefFuT2MOpnHo/1Q7f1kMtjsyJaLo0oZHxQq98RUjpecXy+fW+0Vjonkrpg33hr5Xgaw==",
"requires": { "requires": {
"@types/geojson": "1.0.6", "@types/geojson": "1.0.6",
"@types/json-patch": "0.0.30", "@types/json-patch": "0.0.30",
"json-patch": "0.7.0", "json-patch": "0.7.0",
"jsonschema": "1.2.4" "jsonschema": "1.2.4",
"ts-optchain": "0.1.2"
} }
}, },
"@openstapps/core-tools": { "@openstapps/core-tools": {
@@ -3268,6 +3269,11 @@
} }
} }
}, },
"ts-optchain": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ts-optchain/-/ts-optchain-0.1.2.tgz",
"integrity": "sha512-Xs1/xpXgTQhvgjP1qLIm5LWsgwAdpRnlfrHvMTyMPCNb4MP0WgYGCnK4xJBx0l4ZM+//IDubrmHkvp6BWfZfCg=="
},
"tslib": { "tslib": {
"version": "1.9.3", "version": "1.9.3",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",

View File

@@ -20,7 +20,7 @@
"tslint": "tslint 'src/**/*.ts'" "tslint": "tslint 'src/**/*.ts'"
}, },
"dependencies": { "dependencies": {
"@openstapps/core": "0.11.0", "@openstapps/core": "0.12.0",
"@openstapps/core-tools": "0.3.0", "@openstapps/core-tools": "0.3.0",
"@openstapps/logger": "0.0.5", "@openstapps/logger": "0.0.5",
"config": "3.0.1", "config": "3.0.1",

View File

@@ -72,12 +72,12 @@ export function parseAggregations(
aggregationNames.forEach((aggregationName) => { aggregationNames.forEach((aggregationName) => {
const buckets = aggregations[aggregationName].buckets; const buckets = aggregations[aggregationName].buckets;
const facet: SCFacet = { const facet: SCFacet = {
buckets: buckets.map((bucket) => { buckets: buckets.map((bucket) => {
const facetBucket: { [value: string]: number } = {}; return {
facetBucket[bucket.key] = bucket.doc_count; count: bucket.doc_count,
return facetBucket; key: bucket.key,
};
}), }),
field: aggregationSchema[aggregationName].terms.field + '.raw', field: aggregationSchema[aggregationName].terms.field + '.raw',
}; };