Skip to content

Remove 'slug' field on Document parts #3328

@chaecramb

Description

@chaecramb

What

Remove the slug field from document parts once all documents have had their link field populated in elasticsearch.

Why

A Search API document contains an array of parts which are built from information stored in the attachments key of details fetched from Publishing API. Previously, the parts contained only three attributes: slug, title, body. PR (#3271) added a link field to parts.

This new field is the fully qualified path for the part, which was necessary to deal with a bug where Finder Frontend lacked the information to correctly build links for parts where they have urls with an additional path segment. For example, consultation outcomes sit under <parent>/outcome/<part>.

The known document types that presented this issue, consultations and calls for evidence with outcomes, have been bulk republished in order to populate this field in elasticsearch.

Search API now tries to use link where it is populated and falls back to slug where it is not.

The slug field is now deprecated (#3325). Eventually slug should be entirely removed, but only after we are confident every document with either parts or attachments has had the link field populated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions