Skip to content

Index no search document for an entity without a database row #61

Closed

Description

@johnf

Parent

#52

What to build

arocapi requires a database row for every search hit, and otherwise drops the hit while still counting it in total and the facets. The search indexer reads the crate's rows from the database (by meta.crateId) and indexes only the entities that have one, logging each one it skips. A search's total then matches the hits a user can page through.

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

Acceptance criteria

  • An entity whose database row fails to be written gets no search document, and the skip is logged with the crate and entity ids
  • A search's total and facet counts match the hits returned when such a failure occurred
  • Indexing the rest of the crate is unaffected
  • Tested through the API

Activity

  1. johnf commented on Nov 4, 2026

    @johnf
    CollaboratorAuthor

    Implemented in #63. Changed from the original ticket: rather than being handed the ids the database indexer wrote, the search indexer reads the crate's rows itself (by meta.crateId), which also gives each document its rootCollection and works when only the search index is rebuilt. When a crate has no rows at all, the skip is logged once for the crate. The body is updated to match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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