diff --git a/lib/jsonld_serializers.js b/lib/jsonld_serializers.js index 0cc003f..f184a9d 100644 --- a/lib/jsonld_serializers.js +++ b/lib/jsonld_serializers.js @@ -498,6 +498,9 @@ class AggregationSerializer extends JsonLdItemSerializer { } else if (field === 'buildingLocation') { // Build buildingLocation agg labels from nypl-core: v.label = locations[v.value]?.label + } else if (field === 'recordType') { + // Build buildingLocation agg labels from nypl-core: + v.label = recordTypes[v.value]?.label } else { v.label = v.value } diff --git a/lib/resources.js b/lib/resources.js index 0594f3a..d0a60ab 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -32,6 +32,7 @@ const ITEM_FILTER_AGGREGATIONS = { // Configures aggregations: const AGGREGATIONS_SPEC = { + recordType: { terms: { field: 'recordTypeId' } }, buildingLocation: { terms: { field: 'buildingLocationIds' } }, owner: { nested: { path: 'items' }, aggs: { _nested: { terms: { field: 'items.owner_packed' } } } }, subjectLiteral: { terms: { field: 'subjectLiteral.raw' } },