Skip to content

SOLR-18332: More 'qt' removal, rd 4 - #4731

Open
gerlowskija wants to merge 7 commits into
apache:mainfrom
gerlowskija:qt-removal-rd-4
Open

SOLR-18332: More 'qt' removal, rd 4#4731
gerlowskija wants to merge 7 commits into
apache:mainfrom
gerlowskija:qt-removal-rd-4

Conversation

@gerlowskija

@gerlowskija gerlowskija commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The 'qt' parameter and several related methods in SolrJ are deprecated.
This deprecation may not stick, but it's still worth minimizing use of this
feature as much as possible.

Many tests rely on it unnecessarily; this PR is one in a number of batches
slowly removing these usages. This batch in particular is focused on
removing QT usage in solr-core tests, particularly those for the "suggest"
and "spellcheck" features along with a number of lingering '/get' tests and
usages.

The 'qt' parameter and several related methods in SolrJ are deprecated.
This deprecation may not stick, but it's still worth minimizing use of this
feature as much as possible.

Many tests rely on it unnecessarily; this PR is one in a number of batches
slowly removing these usages. This one focuses on solr-core tests that
dispatch through the req()/assertQ/assertJQ/assertQEx helpers; passing the
handler explicitly instead of embedding it as a 'qt' request param.
Replaces a number of 'qt' usages with the new reqWithPath helper
function, this time focusing mainly on suggest and spellcheck related
tests in solr-core.

@epugh epugh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Less "oh wow, that is so nice to read: then the earlier rounds, but I guess to be expected!

Extends the reqWithPath conversion to the real-time-get, recovery, and
versions test files, replacing req("qt", "/get", ...) with
reqWithPath("/get", ...) so these tests no longer rely on the
deprecated qt parameter to select the handler.
Continues the reqWithPath conversion into the update-processor tests
(AtomicUpdatesTest, NestedAtomicUpdateTest, TestDocBasedVersionConstraints,
TestInPlaceUpdatesStandalone, TestUpdate), the /get-based schema tests
(BooleanFieldTest, TestPointFields, TestPseudoReturnFields), and a mix of
other req()+assertQ call sites (AlternateDirectoryTest, RequestHandlersTest,
SegmentsInfoRequestHandlerTest, LukeRequestHandlerTest, MinimalSchemaTest,
DisMaxRequestHandlerTest, PhrasesIdentificationComponentTest,
ResponseLogComponentTest) that relied on the deprecated qt parameter to
select a handler.
@gerlowskija

Copy link
Copy Markdown
Contributor Author

(Check and tests pass locally for me, just as a reminder for when I aim to merge this eventually)

"multi boost query",
req(
reqWithPath(
qt,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if the parameter qt can be renamed to path? Just from readnig the diff, I think this is now a variable holding the specific path?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah good thought - if I do eventually succeed in getting 'qt' removed then variable names like this won't make any sense.

OTOH, renaming this variable (and others like it) will make the diff much less homogeneous. Right now every line in this diff is a req -> reqWithPath swap. But if you as a reviewer don't mind adding that noise to the diff (?), then I don't either I guess

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't mind noise... have you seen my pr's!???? Ooh, let me go fix that random typo ;-)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but seriously, for me success means the letters q & t never show up in our code base next to each other.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Absolutely - that's my aim too. For me it's only a question of "this PR, or some other one".

I've griped a lot lately about how review-blocked every effort is these days now that Claude or whatever LLM has made the actual code-generation easier. And so I've been trying to think through: "This is going to be an absolute ton of changes; how do I structure that across multiple PRs to shrink as much as possible the time folks would need to spend in review".

Extremely homogeneous PRs were my attempt at that, but it sounds like you're OK with loosening that a bit in order to cover more ground in fewer PRs, which I get. Will update this shortly 👍

"q", "foo:bar",
"omitHeader", "false"),
reqWithPath(
handler, // this should be fairly innocuous for any type of query

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i wonder if using the Solr specific term handler still makes sense, or we should just say path?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't love the use of "handler" as it's very v1 specific and a bit vestigial. But I think there is a bit of a difference in terms of how we use it colloquially: I think most folks use "Handler" to refer specifically to the last path-segment (i.e. /export) and "path" to talk about the whole path (i.e. /solr/collection1/export).

It'd be nice if we had a v1/v2 agnostic name for "that part of the path that comes after the collection/core name", but right now I think "handler" is kindof serving that role.

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.

2 participants