Skip to main content

search-api: Rake tasks

These rake tasks come from the desc descriptions in search-api’s lib/tasks folder. To change what’s shown here, change the description in the code.

Pretty print a document in the govuk index

k exec deploy/search-api -- rake debug:show_govuk_link

View source (lib/tasks/debug.rake)

debug:show_new_synonyms

New synonyms test

k exec deploy/search-api -- rake debug:show_new_synonyms

View source (lib/tasks/debug.rake)

debug:fetch_best_bets

Get the best bets which match a query

k exec deploy/search-api -- rake debug:fetch_best_bets

View source (lib/tasks/debug.rake)

debug:check_recovery

Check whether a restored index has recovered

k exec deploy/search-api -- rake debug:check_recovery

View source (lib/tasks/debug.rake)

Delete a document from the govuk index by link

k exec deploy/search-api -- rake delete:by_link
More about this task
Usage
rake 'delete:by_link[link]'

View source (lib/tasks/delete.rake)

delete:by_format

Delete all documents by format from the govuk index.

k exec deploy/search-api -- rake delete:by_format
More about this task
Usage
rake 'delete:by_format[format_name]'

View source (lib/tasks/delete.rake)

duplicates:find

Find all documents with the same content_id

k exec deploy/search-api -- rake duplicates:find

View source (lib/tasks/duplicates.rake)

duplicates:remove

Find all documents with the same content_id and remove them

k exec deploy/search-api -- rake duplicates:remove

View source (lib/tasks/duplicates.rake)

elasticdump

Copies data across two clusters

k exec deploy/search-api -- rake elasticdump

View source (lib/tasks/elasticdump.rake)

search:list_indices

Lists current indices, pass [all] to show inactive indices

k exec deploy/search-api -- rake search:list_indices

View source (lib/tasks/indices.rake)

search:create_all_indices

Create a brand new indices and assign an alias if no alias currently exists

k exec deploy/search-api -- rake search:create_all_indices
More about this task
Specify clusters to run this against; by default runs against all clusters.

View source (lib/tasks/indices.rake)

search:create_index

Create a brand new index and assign an alias if no alias currently exists

k exec deploy/search-api -- rake search:create_index

View source (lib/tasks/indices.rake)

search:lock

Lock the index for writes

k exec deploy/search-api -- rake search:lock

View source (lib/tasks/indices.rake)

search:unlock

Unlock the index for writes

k exec deploy/search-api -- rake search:unlock

View source (lib/tasks/indices.rake)

search:update_popularity

Update popularity data in govuk index.

k exec deploy/search-api -- rake search:update_popularity
More about this task
Update all data in the index inplace (without locks) with the new popularity
data using sidekiq jobs.

This does not update the schema.

View source (lib/tasks/indices.rake)

search:update_supertypes

Update supertypes from govuk_document_types gem.

k exec deploy/search-api -- rake search:update_supertypes
More about this task
Update all data in the index inplace (without locks) with supertypes from the
govuk_document_types gem using sidekiq jobs.

This does not update the schema.

View source (lib/tasks/indices.rake)

search:migrate_schema

Migrate the data to a new schema definition

k exec deploy/search-api -- rake search:migrate_schema
More about this task
Lock the current index, migrate all the data to a new index,
wait for the process to complete, switch to the new index and
release the lock.

You should run this task if the index schema has changed.

Specify a list of clusters `migrate_schema['A B C']` if you like, otherwise
this task will run against all active clusters.

View source (lib/tasks/indices.rake)

search:update_schema

Update the schema in place to reflect the current Search API configuration. This task is idempotent.

k exec deploy/search-api -- rake search:update_schema
More about this task
If there are changes to configuration that cannot be made to the live schema because the change is not applicable to
the existing data, you will need to run the "migrate_schema" task instead, which requires locking the index.

View source (lib/tasks/indices.rake)

search:switch_to_named_index

Switches an index group to a specific index WITHOUT transferring data

k exec deploy/search-api -- rake search:switch_to_named_index

View source (lib/tasks/indices.rake)

search:clean

Cleans out old indices

k exec deploy/search-api -- rake search:clean

View source (lib/tasks/indices.rake)

search:timed_clean

Cleans out unused indices older than the number of days given by the MAX_INDEX_AGE flag

k exec deploy/search-api -- rake search:timed_clean

View source (lib/tasks/indices.rake)

message_queue:create_queues

Create the queues that Rummager uses with Rabbit MQ

k exec deploy/search-api -- rake message_queue:create_queues

View source (lib/tasks/message_queue.rake)

message_queue:insert_data_into_govuk

Gets data from RabbitMQ and insert into govuk index

k exec deploy/search-api -- rake message_queue:insert_data_into_govuk

View source (lib/tasks/message_queue.rake)

message_queue:bulk_insert_data_into_govuk

Gets data from RabbitMQ and insert into govuk index (bulk reindex queue)

k exec deploy/search-api -- rake message_queue:bulk_insert_data_into_govuk

View source (lib/tasks/message_queue.rake)

page_traffic:load

Bulk load data from Google Analytics

k exec deploy/search-api -- rake page_traffic:load

View source (lib/tasks/page_traffic.rake)

publishing_api:publish_finder

Publish finder and email signup content items

k exec deploy/search-api -- rake publishing_api:publish_finder
More about this task
Usage:
FINDER_CONFIG=news_and_communications_finder.yml EMAIL_SIGNUP_CONFIG=news_and_communications_email_signup.yml rake publishing_api:publish_finder

View source (lib/tasks/publishing_api.rake)

publishing_api:publish_supergroup_finders

Publishes supergroup finders and their email signup pages

k exec deploy/search-api -- rake publishing_api:publish_supergroup_finders

View source (lib/tasks/publishing_api.rake)

publishing_api:unpublish_document_finder

Unpublish document finder.

k exec deploy/search-api -- rake publishing_api:unpublish_document_finder

View source (lib/tasks/publishing_api.rake)

jobs:work

Start Sidekiq workers

k exec deploy/search-api -- rake jobs:work

View source (lib/tasks/queue.rake)

ranking_evaluation

Check how well the search query performs for a set of relevancy judgements

k exec deploy/search-api -- rake ranking_evaluation

View source (lib/tasks/ranking_evaluation.rake)

report_inconsistent_aggregate_values

Check for and report any non-expanded aggregate values

k exec deploy/search-api -- rake report_inconsistent_aggregate_values

View source (lib/tasks/report_inconsistent_aggregate_values.rake)

report_inconsistent_facet_values

Check for and report any non-expanded facet values [DEPRECATED]

k exec deploy/search-api -- rake report_inconsistent_facet_values

View source (lib/tasks/report_inconsistent_aggregate_values.rake)

sitemap:generate_and_upload

Generate new sitemap files and upload to S3

k exec deploy/search-api -- rake sitemap:generate_and_upload

View source (lib/tasks/sitemap.rake)

traffic_replay:format_logs

Reformat csv search traffic logs to gor format

k exec deploy/search-api -- rake traffic_replay:format_logs

View source (lib/tasks/traffic_replay.rake)