Skip to content
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

search-api: Index grep with dump rather than calling endpoints #572

Merged
merged 8 commits into from
Jan 14, 2025

Conversation

jnatten
Copy link
Contributor

@jnatten jnatten commented Jan 8, 2025

Dette ble mer greier enn planlagt, men dette funker nå! 😄

  • Indekserer grep ved å hente og unzippe dump'en fremfor å kalle endepunkter
    • For å få ut mer data (feks tilhoerer-laereplan o.l)
  • Deler opp output'en i flere typer som vi kan guarde med typename i graphql.
  • Deprekerer gammelt grep søk i draft-api

This downloads and extracts a zip of the grep dump to build the
`GrepBundle`. This allows us to extract more information about each
kode, doesn't really seem that much slower either.
This is replaced by the grep search in search-api.
The endpoint will still work for now, but the data will no longer be
updated when saving a draft.
To allow us to completely skip calling the udir grep api from the
frontend/graphql we need more data! This patch includes everything(?) we
need to stop calling the grep api directly from elsewhere.
Since scala-tsi messes up adding the `typename` discriminator we need to
hack around it by adding the fields manually to the variants that does
not get it 🤷
I broke some tests in the rewrite to fetching grep information via the
zipped dump. This patch fixes those.
Copy link
Member

@gunnarvelle gunnarvelle left a comment

Choose a reason for hiding this comment

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

Skulle vi tatt med erstattesAv og gjenbrukAv?

Copy link
Member

@gunnarvelle gunnarvelle left a comment

Choose a reason for hiding this comment

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

lgtm

@jnatten jnatten merged commit 89f6a00 into master Jan 14, 2025
26 checks passed
@jnatten jnatten deleted the grep-dump-indexing branch January 14, 2025 05:34
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.

2 participants