Skip to content

WIP: Add admin search for info requests - #9439

Draft
laurentS wants to merge 4 commits into
developfrom
admin-search-info-requests
Draft

WIP: Add admin search for info requests#9439
laurentS wants to merge 4 commits into
developfrom
admin-search-info-requests

Conversation

@laurentS

@laurentS laurentS commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Relevant issue(s)

#8814

What does this do?

This PR marks InfoRequest as searchable with the new search engine.

Why was this needed?

Implementation notes

This is mostly adapted from the previous PR for PublicBody.
I took the opportunity to optimise the view a bit as well. For a full page of requests, the rendering time is divided by 2-4 locally, and number of requests to db drop from ~416 to ~20.

This is probably one of the models where initial indexing time is going to matter a bit, at least for WDTK. If it runs at roughly the same speed as my local test, you're looking at ~6.5h of indexing time. I will try to implement a more generic version of the reindex_all I wrote in https://github.com/mysociety/alaveteli/pull/9415/changes, which can be used by the various models that don't need any ruby attributes in their SearchDocuments.

Screenshots

Notes to reviewer


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

Comment thread app/models/info_request.rb
@laurentS

laurentS commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

Added another commit to do a much faster reindex_all. For my test dataset, 53k requests, it reindexes the entire set in 1.5 seconds, VS 3min 5 sec with the default reindex_all. So you should get a full reindex in under a minute for WDTK, assuming similar hardware.

The method is generic enough to also take care of MailServerLog and any model that only indexes SQL constructs.

@laurentS
laurentS force-pushed the admin-search-info-requests branch from e3dcdb1 to a7dec83 Compare August 7, 2026 16:05
@laurentS
laurentS force-pushed the admin-search-info-requests branch 2 times, most recently from 0ab3be3 to 813002e Compare August 7, 2026 16:25
@laurentS
laurentS force-pushed the admin-search-info-requests branch from 813002e to 3b9a7af Compare August 7, 2026 16:51
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