Finder frontend renders search on GOV.UK.
Site search is available from the header of every page.
Finder pages provide facetted searching over a collection of documents.
- gov.uk/aaib-reports
- gov.uk/cma-cases
- gov.uk/drug-safety-update
- gov.uk/drug-device-alerts
- gov.uk/government/case-studies
- gov.uk/government/groups
- gov.uk/government/people
- gov.uk/world/organisations
- gov.uk/international-development-funding
- gov.uk/maib-reports
- gov.uk/raib-reports
The advanced search finder provides facetted searching of GOV.UK taxonomy and content types:
Read more about the advanced search finder
- Finder: Page containing a list of filterable documents and filters.
- Facets: Metadata associated with documents.
- Filters: Searchable/filterable metadata for example
case_state={open|closed}
for a CMA case.
- alphagov/static: provides static assets (JS/CSS) and provides the GOV.UK templates.
- alphagov/content-store: provides the content items for the finder itself -- containing the finder title, tagged organisations and related links
- alphagov/rummager: provides search results
$ ./startup.sh
If you are using the GDS development virtual machine then the application will be available on the host at http://finder-frontend.dev.gov.uk/
Before you can run the test suite you'll need the govuk-content-schemas
repository locally. See
lib/govuk_content_schema_examples.rb
for more
details.
The default rake
task runs all the tests:
$ bundle exec rake
The application has jasmine tests, which can be accessed at /specs
when the application is running in development mode. These are also run when rake
, above, is run.
To run JavaScript tests separately:
bundle exec rake jasmine:test
- If required, add a schema to alphagov/rummager describing your document type -- example
- Publish a Finder Content Item to the content store. See the doc for Finder Content Item for more info.
- Ensure your documents are indexed in alphagov/rummager correctly.
You can run this application with a local file so you can develop a finder without having to publish the content item to the publishing-api.
For example:
DEVELOPMENT_FINDER_JSON=features/fixtures/aaib_reports_example.json ./startup.sh --live
You can use gov.uk/api/search.json?filter_link= with the path of the page you looking for to migrate.
For example, you want to filter by the field link
on /government/world/organisations
You can access the following: https://www.gov.uk/api/search.json?filter_link=/government/world/organisations/british-antarctic-territory
You will be able to see inside results the field format
You can double check the filter by performing the following search using rummager:
http://rummager.dev.gov.uk/search.json?filter_NAME=VALUE
For more information please refer to the search api documentation.
See the documentation on the Q&A frontend and how it relates to a finder.
- No data store -- all data comes via the APIs mentioned above.
app/models
contains two kinds of object.- Value objects used to wrap up responses from API calls.
- Facet objects which wrap up the behaviour of different types of facet -- eg radios, selects, etc.
app/presenters
contains objects which serialise the value objects to hashes for display via mustache.app/parsers
contains objects which transform API responses into models.