Skip to content

Refactor Opensearch interface to make filters more unified #5834

@neilmb

Description

@neilmb

Purpose

We want to make it easier to add filters to our site, but we're not sure how to do that.

Given above uncertainty, conducting research is needed to provide factual knowledge on future steps.

One week of effort has been allocated and once compete, findings will be demonstrated and specific future actions will be decided.

Acceptance Criteria

  • GIVEN we have many, many search filters
    AND we probably want to add more
    WHEN one week of work expires
    THEN we will have explored various code refactorings
    AND we will know which one we prefer
    AND we've made follow-on tickets if necessary

Background

Filters appear on our search pages, then express themselves as arguments in our /search API, then get passed in to our interface.py methods and then further on into our opensearch.py interface where they manifest as particular adjustments to the Opensearch queries that we run.

Currently, to add a new search filter we have to do the UI work on the search pages, and then plumb everything together by hand through all those layers. Can we do better and come up with a generic approach to filtering that makes it easier to express the filters we have and easier to add new filters in the future?

Sketch

Is there an object-oriented approach where we have something like a Filter class that can encapsulate how that filter shows up on the page, in an API, in our methods, and in an OpenSearch query?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    📟 Sprint Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions