Table of contents


Manually setting the search popularity of content

To look up the popularity of an item you can query Elasticsearch by creating a tunnel to the cluster:

ssh -At -L 9200:localhost:9200 "ssh -q \`govuk_node_list --single-node -c search\` -L"

To looking up popularity of a particular item you will need its base_path URL encoded and then look it up with a curl command:

$ curl localhost:9200/government/generic-document/%2Fgovernment%2Fpublications%2Fdraft-capital-requirements-amendment-eu-exit-regulations-2018?stored_fields=popularity

Once popularity is determined we can then update with the new popularity using the following command:

$ curl -XPOST
-d '{"doc": {"popularity": 10}}'
This page was last reviewed on 26 March 2019. It needs to be reviewed again on 26 September 2019 by the page owner #govuk-developers .
This page was set to be reviewed before 26 September 2019 by the page owner #govuk-developers. This might mean the content is out of date.