-
-
Notifications
You must be signed in to change notification settings - Fork 143
Hearing search index #1960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Hearing search index #1960
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
documentTrigger: "events/{eventId}", | ||
alias: "hearings", | ||
idField: "id", | ||
filter: data => data.type === "hearing", |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
number: doc.BillNumber, | ||
slug: `${doc.GeneralCourtNumber}/${doc.BillNumber}` |
There was a problem hiding this comment.
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.
handles the backend search part of #1897
Steps to reproduce
yarn dev:up
, wait for search-backfill to complete. should complete without error.yarn typesense-admin -e local console
. In that console, runawait client.collections('hearings').retrieve()