alphagov / govuk-knowledge-graph-gcp

GOV.UK content data and cloud infrastructure for the GovSearch app.
https://docs.data-community.publishing.service.gov.uk/tools/govgraph/
MIT License
10 stars 1 forks source link

feat: add 'people' column to search.page #676

Closed nacnudus closed 5 months ago

nacnudus commented 6 months ago

A GovSearch user asked to filter for pages that are associated with a given person. This will require changes in the GovSearch repository too https://github.com/alphagov/govuk-knowledge-graph-search

This doesn't disambiguate between people who have the same name. There are 81 different names that are each used by multiple people. Some of them seem to be duplicates of the same person, such as:

The could perhaps be disambiguated in GovSearch by their photograph (if it exists), or base path, or description, or body text. That would require a drastic change to the selector. Another option would be to number them, e.g. "Lord Jonathan Evans KCB DL (1)", "Lord Jonathan Evans KCB DL (2)", but we couldn't guarantee to number them consistently, because one of the instances of those people could be removed in a subsequent update to GOV.UK.

SELECT
  title,
  ARRAY_AGG(id) AS ids,
  ARRAY_AGG(base_path) AS base_paths
FROM
  public.publishing_api_editions_current
WHERE
  TRUE
  AND schema_name = 'person'
  AND locale = 'en'
GROUP BY
  title
HAVING
  COUNT(*) > 1
guilhem-fry commented 5 months ago

Deployed and tested in all three environments