Skip to content

Align articles/events filters on API faceting principles #121

@agnesgaroux

Description

@agnesgaroux

NEW TICKET DESCRIPTION

After discussing this further, we decided the former ticket description wasn't exactly what was needed, but keeping it for legacy conversations.

See comments in ticket for more information as to what was decided upon, starting here.

FORMER TICKET DESCRIPTION

https://github.com/wellcomecollection/docs/tree/main/rfcs/037-api-faceting-principles
See Principle 1.

Filters are named by the JSON paths of the identified object that they filter or, if applied to an attribute other than the identifier, the path of that attribute

This is not something that has been abided by in content-api:
NOTE: this example is articles but same thing with events
Article doc XkvmsREAACUAUWwN has a filter object like

        "filter": {
            "contributorIds": [ // should be "contributors.contributor"
              "XjQP8BQAACQANdYu",
              "XjFs8xQAACMAKkcQ"
            ],
            "formatId": "W7TfJRAAAJ1D0eLK",  // should be "format"
            "publicationDate": "2020-02-27T11:31:56.000Z"

and display

 "display": {
      "type": "Article",
      "id": "XkvmsREAACUAUWwN",
      "title": "The ‘undesirable epileptic’",
      "caption": "Abused in her marriage for being 'a sick woman', Aparna Nair looked to history to make sense of the response to her epilepsy. 
She discovered how centuries of fear and discrimination were often endorsed by science and legislation.",
      "format": {
        "type": "ArticleFormat",
        "id": "W7TfJRAAAJ1D0eLK",
        "label": "Article"
      },
      "publicationDate": "2020-02-27T11:31:56+0000",
      "contributors": [
        {
          "type": "Contributor",
          "contributor": {
            "type": "Person",
            "id": "XjQP8BQAACQANdYu",
            "label": "Aparna Nair"
          },
          "role": {
            "type": "EditorialContributorRole",
            "id": "WcUWeCgAAFws-nGh",
            "label": "Author"
          }
        },
        {
          "type": "Contributor",
          "contributor": {
            "type": "Person",
            "id": "XjFs8xQAACMAKkcQ",
            "label": "Tracy Satchwill"
          },
          "role": {
            "type": "EditorialContributorRole",
            "id": "XVQa_xMAACMAqbwo",
            "label": "Illustrator"
          }
        }
      ],
    }

This entails

  • changing the transformers
  • reindexing the data
  • change the value of filters/aggs in the API
  • wc.org to use new values for query params

Metadata

Metadata

Assignees

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