Skip to main content
Table of contents


Content that doesn't show up correctly in search or list pages

The Elasticsearch cluster utilised by Search API can get out of sync with publishing applications. This affects any part of the site using it, including navigation pages and related links.

Root cause

For Whitehall document formats (i.e. those that have not been migrated to the new index), Search API depends on requests from whitehall admin to stay up to date. This is a “fire and forget” task that doesn’t block the user’s publishing action, and if anything goes wrong, the search data will stay unchanged until the next time an update is made to the document.

See search-api ADR 004 for details of how we improved this for non-whitehall formats.

Check if search is the problem

A page with URL /council-tax can be queried using /api/search.json?filter_link=/council-tax. You can quickly switch between the two using the GOV.UK browser extension.

You can compare the data returned with the publishing app to check if it’s up to date. An empty response means search has never received the content.

You can also request different fields, for example /api/search.json?filter_link=/council-tax&fields=format,content_id.

If the document is missing from the search API, check the search index itself to see if it is present and has the expected fields:

  1. Create a tunnel to Elasticsearch:

    ssh -At -L 9200:localhost:9200 "ssh -q \`govuk_node_list --single-node -c search\` -L"
  2. Send a POST request to http://localhost:9200/govuk/_search:

      "filter": {
        "term": {
          "link": "/the/path/to/the/page"

    Or search by content ID:

      "filter": {
        "term": {
          "content_id": "638db33a-fe73-45fd-96e2-7dcf8281ff16"

If the document is present and looks correct, it suggests that the problem is that the document does not match the search query. You can debug the query by adding the parameter debug=show_query to the search API URL, e.g.

Correct the search data

Most search issues can be fixed by either republishing the content, or manually reindexing via a rake task in the publishing app.

Published content is missing from search/finders/navigation

Try republishing the content.

Unpublished content can be removed from search manually using search admin.

There are blank options on finder pages

See the instructions for fixing blank finder filter options.

This page was last reviewed on 10 May 2019. It needs to be reviewed again on 10 November 2019 by the page owner #govuk-2ndline .
This page was set to be reviewed before 10 November 2019 by the page owner #govuk-2ndline. This might mean the content is out of date.