Skip to content

Find a crate's rows by meta.crateId, and remove search documents through arocapi's backend #59

Closed

Description

@johnf

Parent

#52

What to build

Admin deletes, reindexes and counts find a crate's entities by a crate id stored as meta.crateId on each entity row, not by rootCollection. The search index side goes through arocapi's SearchBackend contract: deleting a crate looks up its entity ids from the database (before deleting the rows) and passes them to remove(ids), and refreshing uses the backend's refresh option instead of a manual refresh. Deleting every crate may still drop the whole OpenSearch index directly. The direct deleteByQuery and count calls go. A crate's search count on the crates page becomes a count of its database rows.

Ships on the one #52 branch and PR, as its own commit. See #52 for the decisions behind it.

Acceptance criteria

  • Every entity row has meta.crateId set to the id of the crate it came from
  • Deleting one crate's indexes from the admin pages removes all its database rows and search documents, including people, organisations and other contextual entities
  • Deleting or reindexing one crate leaves every other crate untouched, including other crates in the same distributed collection
  • The crates page's counts are correct for each crate after indexing
  • No search code queries OpenSearch on rootCollection or relies on the backend's document layout
  • Tested through the admin actions, against the per-run Postgres and OpenSearch

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions