Fix topic page pagination - #3682
Open
shanbady wants to merge 2 commits into
Open
Conversation
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
shanbady
marked this pull request as ready for review
July 27, 2026 15:07
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the vector search count logic used by topic-page pagination so the UI’s total-results count is exact, preventing “extra” pages that render empty results.
Changes:
- Switch Qdrant
countcalls used for pagination totals from approximate (exact=False) to exact (exact=True). - Add a regression test ensuring the vector search endpoint requests an exact count from Qdrant.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| vector_search/views.py | Uses an exact Qdrant count for paginator totals to avoid advertising empty pages. |
| vector_search/views_test.py | Adds a test that asserts the Qdrant count call is made with exact=True. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/12397
Description (What does it do?)
This PR fixes an issue where the topic pages show more pages than can be paginated to. This is due to the use of exact=False for the final count returned by the api which ends up showing more results than there actually are.
How can this be tested?