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

View File

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