Skip to content

Make info request events searchable - #9414

Open
laurentS wants to merge 4 commits into
developfrom
admin-search-info-request-events
Open

Make info request events searchable#9414
laurentS wants to merge 4 commits into
developfrom
admin-search-info-request-events

Conversation

@laurentS

@laurentS laurentS commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Relevant issue(s)

#8814
#8816

What does this do?

This makes InfoRequestEvents searchable via the new postgres based search system.
It also adds a search page for events, along with a simple edit form to remove PII.

Why was this needed?

Implementation notes

The JSON blobs can contain a lot of information that isn't useful to keep in the search index (eg. refs to user IDs, timestamps...). This uses a SQL stored function to preprocess the data inside postgres. The benefit compared to doing this in ruby-land is that the SearchDocument can be upserted in a single SQL query, instead of at least 2 if doing it in ruby. When batching updates, it's even possible to do the entire batch in a single SQL query (see #9334 (comment) about DB roundtrip overhead).
Given the number of events in the db, the time saving should be very substantial (see below).

Screenshots

The search page:
image

The edit page:
image

which is limited to the JSON params attribute, to limit risk of breaking data consistency. I didn't see an obvious existing way to validate the json content. I believe maybe def params= should do that?

Notes to reviewer

Ideally merge this after #9439 to benefit from the faster reindex_all implementation in that PR, which is likely to reduce the initial indexing time by a lot.
Edit: on 328k events, the faster reindex_all ran in 10s on my laptop, vs several minutes with the default version.


Have you updated the changelog? If this is not necessary, put square brackets around this: [skip changelog]

@laurentS
laurentS force-pushed the admin-search-info-request-events branch from 5759038 to c2d085b Compare August 12, 2026 08:28
This only allows modifying the params attribute, as the anticipated use
case is removal of personal data, which can only happen in this
particular attribute. This limits the risk of causing data
inconsistency.
@laurentS
laurentS force-pushed the admin-search-info-request-events branch from c2d085b to e45213f Compare August 14, 2026 15:26
@laurentS
laurentS force-pushed the admin-search-info-request-events branch from e45213f to f07ff81 Compare August 14, 2026 15:30
@laurentS
laurentS marked this pull request as ready for review August 14, 2026 15:55
@laurentS laurentS changed the title WIP: Make info request events searchable Make info request events searchable Aug 14, 2026
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