Skip to main content
Last updated: 9 Dec 2024

Update the search autocomplete denylist

The autocomplete functionality for GOV.UK Site Search makes use of a denylist to avoid suggesting terms that are not suitable for GOV.UK.

To update this list requires following a manual process:

  1. In a text editor create a new empty file, save this file as denylist.jsonl
  2. Access the spreadsheet and apply the desired changes to the appropriate spreadsheet
  3. Copy and paste the contents from the “denylist” column from each spreadsheet into your created denylist.jsonl file

Then for each GOV.UK environment of integration, staging and production:

  1. Log into Google Cloud and access the Search API V2 <environment> project
  2. Access “Cloud Storage” > “Buckets” and find the search-api-v2-<environment>_vais_artifacts bucket
  3. Upload the denylist.jsonl file to the bucket, replacing the existing file
  4. Leave Google Cloud and open your terminal
  5. Log into the appropriate environment for Kubernetes
  6. Run the rake autocomplete:update_denylist rake task for search-api-v2 to import the file

If there are problems updating the denylist we can consider disabling the autocomplete feature temporarily to provide time to resolve the problem.