Repository navigation
feat(packages): add subjects major headings facet to packages search - #724
Merged
Merged
Conversation
Add filter[subject] query parameter to GET /eholdings/packages and return a facets.subjects list (major headings only, ordered by count descending) in the packages collection response. The facet is requested from HoldingsIQ only when a query or filter is present. Non-numeric filter[subject] values are rejected with 400. Bump eholdings interface to 5.1. Refs: MODKBEKBJ-850
# Conflicts: # NEWS.md
psmagin
requested changes
Oct 20, 2026
|
psmagin
approved these changes
Oct 20, 2026
Aliaksandr-Fedasiuk
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Purpose
Packages search needs to display a "Subjects - Major headings" facet so users can narrow packages by subject. This change adds the facet to the packages search response and a filter to apply selected subjects.
Approach
GET /eholdings/packagesgets an optional repeatablefilter[subject]query parameter. It is declared asstring[]and each value must be an integer subject id. RMB passes list query parameters as raw strings whatever element type the RAML declares, so the values are validated inPackageFilterValidator(a new entry in itsVALIDATORStable, non-numeric values return 400) and converted to integers inPackageRecordFilter.toClientFilter.GET /eholdings/packagesgets an optionalsubjectFacetCountquery parameter. When it is not provided,nullis passed to the HoldingsIQ client, which then uses its own default (1000).facetstoinclude=subject) forGET /eholdings/packages, so facets are returned whenever HoldingsIQ has them. The provider packages endpoint does not request facets.facets.subjectsfield. A newpackageFacets.jsonholds it (the sharedfacets.jsonis untouched, because titles have no subjects).PackageFacetsConverterkeeps only major headings (noparentId) that have a positive count, skips null entries, passes counts through unchanged and orders them by count descending.filter[subject]is treated like the other HoldingsIQ filters (e.g.filter[custom]): it is part ofPackageRecordFilter.searchCriteriaValues(), so a request withfilter[tags]orfilter[access-type]plusfilter[subject]goes to HoldingsIQ instead of the database path, and the tags/access type are ignored in that case, as they already are forq,filter[custom]andfilter[selected].FilterValidatorLogicis now generic over the validated parameter type so that list parameters can use the same validation table.PackageFilterValidatorskips validation only for requests that actually take the database (tags / access type) path.AGENTS.mdwith guidance for AI coding agents.Changes Checklist
GET /eholdings/packagesgets the optionalfilter[subject]andsubjectFacetCountquery parameters and an optionalfacets.subjectsresponse field (ramls/packages.raml,ramls/types/packages/packageCollection.json,ramls/types/packages/packageFacets.json,ramls/types/packages/subjectFacet.json).eholdingsstays at 5.0: the major bump from 4.0 (last release v7.0.2) is already part of the unreleased 8.0.0, and the new parameters and field are additive.PackageFacetsConverterTestandPackageRecordFilterTest; extendedPackageCollectionResultConverterTestandEholdingsPackagesImplTest.EholdingsPackagesIntegrationTestcovers the facet response and thesubjectfilter/subjectfacetcountsent to HoldingsIQ, the always-requested facet,filter[subject]combined withfilter[tags], and 400 responses for invalidfilter[subject](parameterized together with thefilter[custom]validation cases).filter[subject]values was found (see below).Notes for reviewers
filter[subject]values combine with AND, not OR. The ticket (AC5) describes OR. HoldingsIQ returns only packages that have all the selected subjects, so the RAML description states AND semantics. This needs a decision on the ticket / with the UI (UIEH-1549) if OR is required.GET /eholdings/packagescall and the result depends on what HoldingsIQ returns. When HoldingsIQ returns no facets,facetsis omitted from the response.subjectfacetcount, which can be overridden by the newsubjectFacetCountparameter. There is no additional cap in this module.subjectfiltervalues are sent to HoldingsIQ comma-separated byfolio-holdingsiq-client(subjectfilter=1,2), while the ticket examples repeat the parameter.Related Issues
🤖 Generated with Claude Code