WGBH-MLA/AAPB2

Add API endpoint for returning Solr facet information about a query

afred opened this issue · 0 comments

Because

@foo4thought Has brought up a use case for wanting to use the HTTP api for getting additional query information from Solr, such as numFound and facet counts for arbitrary lucene queries.

Background

you can already see this in action accidentally when adding a .json extension to a regular catalog query URL, e.g. https://americanarchive.org/catalog?f[id]=cpb-aacip-ba6625ecc98&format=json&f[access_types][]=all

The problem with this though, is that it's going through blacklight, and the /api queries do not.

However the CatalogController's JSON response includes facet data from Solr while the ApiController's JSON response does not.

Done when

We have an API endpiont (at /api.json or somewhere else equally intuitive) that returns facet data as part of the JSON response.