alphagov/rummager — pull request #260 by rboulton (2014-07-09 12:26:10+00:00)
Title: Facet examples

Add an API to get example documents for each matching facet value.

For example,

/unified_search.json?facet_specialist_sectors=10,examples:5,example_scope:global&count=0&filter_organisations[]=hm-revenue-customs

Returns organisation facets for content tagged with HMRC, including an "examples" section in each returned facet, like:

options": [
{
"value": {
"slug": "paye/statutory-leave-pay",
"examples": {
"total": 21,
"examples": [
{
"title": "Statutory Sick Pay: employee fitness to work",
"link": "/statutory-sick-pay-employee-fitness-to-work"
},
{
"title": "Statutory Maternity Pay: how different employment types affect what you pay",
"link": "/statutory-maternity-pay-how-different-employment-types-affect-what-you-pay"
},
{
"title": "Statutory Sick Pay: how different employment types affect what you pay",
"link": "/statutory-sick-pay-how-different-employment-types-affect-what-you-pay"
},
{
"title": "Statutory Maternity Pay: table of dates for employee entitlement",
"link": "/government/publications/statutory-maternity-pay-table-of-dates-for-employee-entitlement"
},
{
"title": "Statutory Sick Pay: employee circumstances that affect payment",
"link": "/statutory-sick-pay-employee-circumstances-that-affect-payment"
}
]
}
},
"documents": 21
},
...

https://www.pivotaltracker.com/story/show/73388400