dp-frontend-search-controller
A UI for rendering results from the search API.
Getting started
See our Docker Compose Search Stack to run all services end to end.
Alternatively, you can run this service locally alongside our design system and port forward the API router address to our sandbox environment to use data from there.
You can also run all the other dependent services as detailed below.
Dependencies
In order to run the dp-search-api and surface results you will also need to populate the index in some way. This can be done using one of the following:
To use the /relateddata and /previousreleases endpoints you will have to run zebedee.
Additional supplemetary services:
- dp-api-router - the defaults set in
config.go use dp-api-router for sending requests to the Search API and the Topic API.
To send feedback to the dp-feedback-api via the feedback footer you will also need to run:
No further dependencies other than those defined in go.mod
To run some of our tests you will need additional tooling:
Audit
We use dis-vulncheck to do auditing, which you will need to install.
Linting
We use v2 of golangci-lint, which you will need to install.
Configuration
| Environment variable |
Default |
Description |
| API_ROUTER_URL |
http://localhost:23200/v1 |
The URL of the dp-api-router |
| BIND_ADDR |
:25000 |
The port to bind to |
| CACHE_CENSUS_TOPICS_UPDATE_INTERVAL |
30m |
The time interval to update cache for census topics (time.Duration format) |
| CACHE_DATA_TOPICS_UPDATE_INTERVAL |
30m |
The time interval to update cache for data topics (time.Duration format) |
| CACHE_NAVIGATION_UPDATE_INTERVAL |
30m |
The time interval to update cache for navigation bar (time.Duration format) |
| CENSUS_TOPIC_ID |
4445 |
Unique identifier for the census topic, used to get census topics from Topics API |
| DEBUG |
false |
Enable debug mode |
| DEFAULT_DATASET_SORT |
release_date |
The default sort for census dataset finder |
| DEFAULT_LIMIT |
10 |
The default limit of search results in a page |
| DEFAULT_MAXIMUM_LIMIT |
50 |
The default maximum limit of search results in a page |
| DEFAULT_MAXIMUM_SEARCH_RESULTS |
500 |
The default maximum search results |
| DEFAULT_OFFSET |
0 |
The default offset of search results |
| DEFAULT_PAGE |
1 |
The default current page of search results |
| DEFAULT_PREVIOUS_RELEASES_SORT |
release_date |
The default sort for previous releases |
| DEFAULT_RELATED_DATA_SORT |
title |
The default sort for related data |
| DEFAULT_SORT |
relevance |
The default sort of search results |
| ENABLE_AGGREGATION_PAGES |
false |
Enable the aggregation pages, is a combination feature flag with ENABLE_TOPIC_AGGREGATION_PAGES |
| ENABLE_TOPIC_AGGREGATION_PAGES |
false |
Enable the topic aggregation pages, is a combination feature flag with ENABLE_AGGREGATION_PAGES. To enable this, the ENABLE_AGGREGATION_PAGES flag has to be enabled. |
| ENABLE_CENSUS_DIMENSIONS_FILTER_OPTION |
false |
Enable dimensions filter for census dataset finder |
| ENABLE_CENSUS_POPULATION_TYPE_FILTER_OPTION |
false |
Enable populations filter for census dataset finder |
| ENABLE_CENSUS_TOPIC_FILTER_OPTION |
false |
|
| ENABLE_NEW_NAV_BAR |
false |
|
| ENABLE_NLP_SEARCH |
false |
|
| FEEDBACK_API_URL |
http://localhost:23200/v1/feedback |
The public dp-api-router address for feedback, not the internal one |
| GRACEFUL_SHUTDOWN_TIMEOUT |
5s |
The graceful shutdown timeout in seconds (time.Duration format) |
| HEALTHCHECK_CRITICAL_TIMEOUT |
90s |
Time to wait until an unhealthy dependent propagates its state to make this app unhealthy (time.Duration format) |
| HEALTHCHECK_INTERVAL |
30s |
Time between self-healthchecks (time.Duration format) |
| OTEL_BATCH_TIMEOUT |
5s |
Interval between pushes to OT Collector |
| OTEL_EXPORTER_OTLP_ENDPOINT |
http://localhost:4317 |
URL for OpenTelemetry endpoint |
| OTEL_SERVICE_NAME |
"dp-frontend-search-controller" |
Service name to report to telemetry tools |
| OTEL_ENABLED |
false |
Feature flag to enable OpenTelemetry |
| IS_PUBLISHING |
false |
Mode in which service is running |
| PATTERN_LIBRARY_ASSETS_PATH |
"" |
Pattern library location |
| SERVICE_AUTH_TOKEN |
"" |
This is required to identify the controller when it calls the topic API via the API router in publishing mode |
| SITE_DOMAIN |
localhost |
|
| SUPPORTED_LANGUAGES |
[2]string{"en", "cy"} |
Supported languages |
Contributing
See CONTRIBUTING for details.
License
Copyright © 2020 - 2025, Office for National Statistics (https://www.ons.gov.uk)
Released under MIT license, see LICENSE for details.