Skip to main content
Warning This document has not been updated for a while now. It may be out of date.
Last updated: 30 Aug 2023

specialist-publisher: Local Development

It is possible to test changes to specialist finders end-to-end using the govuk docker stack. This is useful to avoid having to reindex all of the content on integration to test changes. Here's how to do it:

  1. Start the specialist publisher and finder frontend services. They will spin up all necessary dependencies.
govuk-docker up specialist-publisher-app -d
govuk-docker up finder-frontend -d
  1. Create the search indices
govuk-docker exec search-api-app env SEARCH_INDEX=all bundle exec rake search:create_all_indices
  1. Create the RabbitMQ exchange for Publishing API to send messages to
govuk-docker exec publishing-api-app bundle exec rake setup_exchange
  1. Create the Search API message queues
govuk-docker exec search-api-app bundle exec rake message_queue:create_queues
  1. Publish the routes for the Search API endpoints
govuk-docker exec search-api-app bundle exec rake publishing_api:publish_special_routes
  1. Publish your finder, for example
govuk-docker exec specialist-publisher-app bundle exec rails publishing_api:publish_finder\[ai_assurance_portfolio_techniques\] 
  1. Run the Search API queue consumer. You need to keep this process running to index published documents.
govuk-docker exec search-api-worker bundle exec rake message_queue:insert_data_into_govuk

When you publish a specialist document, it should be updated in the search results.

Note that elasticsearch data is not persisted when you stop the docker container at present.

Search API configuration changes

When you make changes to the Search API configuration, you will need to migrate to the new schema.

govuk-docker exec search-api-app env SEARCH_INDEX=govuk bundle exec rake search:migrate_schema

Note that you may need to republish documents to see changes to the schema reflected in the search results after migrating.