Skip to content

SOLR-13568: Expand component no longer caches per-page group queries in the filter cache - #5014

Open
nick-boss-tech wants to merge 6 commits into
apache:mainfrom
nick-boss-tech:solr-13568-submit
Open

nick-boss-tech wants to merge 6 commits into
apache:mainfrom
nick-boss-tech:solr-13568-submit

Conversation

@nick-boss-tech

@nick-boss-tech nick-boss-tech commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖 (posted on behalf of Nick Shanin)

https://issues.apache.org/jira/browse/SOLR-13568

What happens today

When paging through expanded groups, ExpandComponent adds the group query for the current page to the request's filter list. That per-page query is specific to the page being returned and is rarely reused, but it is stored in the filter cache anyway, so paging through expanded results fills the filter cache with one-off entries that evict useful ones.

What this change does

The per-page group query is wrapped in a WrappedQuery with caching disabled before it is added to the filter list. It still filters the page exactly as before; it is simply no longer stored in the filter cache. No other query's caching behavior changes.

Proof

Verified at head ac5d60c on 2026-10-06 (local gate: tidy clean, Error Prone compile clean, :solr:core:check -x test green; first verified at head 6b89f64 on 2026-10-04).

  • TestExpandComponent.testPerPageGroupQueriesNotCached pages through expanded groups and asserts the per-page group queries do not land in the filter cache. It fails on the base code, where those queries are cached (re-run at ac5d60c: 9 tests, the new test the only failure, filter cache size expected:<3> but was:<5>), and the suite passes here: TestExpandComponent 9/9.

A choice to check

This change always keeps the per-page group query out of the filter cache. The alternative is a per-request switch that restores the current caching behavior for requests that ask for it. Always-off is the simpler rule and the cached entries are rarely hit, but if maintainers would rather keep cache hits available for repeated identical page requests, the switch is the route to take.

Limits

Only the expand component's per-page group query is excluded from the filter cache. Any other caller that adds single-use queries to a request's filter list keeps the current caching behavior; that broader pattern is out of scope here. The trade: the same page of the same query, requested again by any user, builds the same group query, and before this change that second request could find the filter in the cache; it now recomputes the group filter every time. For a popular first page that recompute is a real, recurring cost, paid in exchange for the filter cache no longer churning while paging. The cost of running the per-page group query uncached was not benchmarked.

Changelog: changelog/unreleased/SOLR-13568.yml (type fixed)

AI assistance

AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant