Skip to content

Commit

Permalink
update aggregations with recordTypeId
Browse files Browse the repository at this point in the history
  • Loading branch information
charmingduchess committed Dec 3, 2024
1 parent dde5b4c commit 5f724e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/jsonld_serializers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions lib/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' } },
Expand Down

0 comments on commit 5f724e6

Please sign in to comment.