Skip to content

Conversation

jicruz96
Copy link
Collaborator

@jicruz96 jicruz96 commented Oct 4, 2025

handles the backend search part of #1897

Steps to reproduce

  1. yarn dev:up, wait for search-backfill to complete. should complete without error.
  2. in another terminal, run yarn typesense-admin -e local console. In that console, run await client.collections('hearings').retrieve()

Copy link

vercel bot commented Oct 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
maple-dev Ready Ready Preview Comment Oct 4, 2025 8:31pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
maple-prod Ignored Ignored Oct 4, 2025 8:31pm

documentTrigger: "events/{eventId}",
alias: "hearings",
idField: "id",
filter: data => data.type === "hearing",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only process events of type hearing

readonly documentTrigger: string
readonly idField: string
readonly convert: (data: DocumentData) => T
readonly filter?: (data: DocumentData) => boolean
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentTrigger /events/{eventId} is more than just hearings, so we add a filter to the search indexer config so we only process hearing events.

Copy link
Collaborator Author

@jicruz96 jicruz96 Oct 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we create the helper .passesFilter() and refactor .syncDocument() to ensure it filters out events we don't want to include in search index

Comment on lines +71 to +72
number: doc.BillNumber,
slug: `${doc.GeneralCourtNumber}/${doc.BillNumber}`
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saving both the bill number and the slug for a more ergonomic/performant browse hearings page later on.

@jicruz96 jicruz96 mentioned this pull request Oct 4, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant