Skip to content

Comments

SOLR-18038: Remove deprecated LocalSolrQueryRequest and use SolrQueryRequestBase#4101

Merged
epugh merged 25 commits intoapache:mainfrom
epugh:SOLR-18038-v2
Feb 12, 2026
Merged

SOLR-18038: Remove deprecated LocalSolrQueryRequest and use SolrQueryRequestBase#4101
epugh merged 25 commits intoapache:mainfrom
epugh:SOLR-18038-v2

Conversation

@epugh
Copy link
Contributor

@epugh epugh commented Feb 4, 2026

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

Description

Migrate from LocalSolrQueryRequest to SolrQueryRequestBase by making SolrQueryRequestBase no longer abstract and including all functionality previously unique to LocalSolrQueryRequest

Solution

Beyond the direct conversion, I've also looked for places we used a NamedList and replaced them with ModifiableSolrParams.

There is this "six parameter" pattern that remains, primarily in tests, but it's done via ModifiableSolrParams method.

Some anonymous subclasses of SolrQueryRequestBase are now explicit. CSVRequest was trivial and could be removed now that SolrQueryRequestBase isn't abstract.

_BIG QUESTION: SHould we rename SolrQueryRequestBase to just SolrQueryRequest and eliminate the interface SolrQueryRequest?

Tests

I've re-run the tests.

} else {
stream = new ContentStreamBase.ByteArrayStream(streamBytes, source, "text/csv");
}
return (new SampleCSVLoader(new CSVRequest(params), maxDocsToLoad)).loadDocs(stream);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here we deleted a trivial class!

* longer in use.
*/
public abstract class SolrQueryRequestBase implements SolrQueryRequest, Closeable {
public class SolrQueryRequestBase implements SolrQueryRequest, Closeable {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we eliminate SolrQueryRequest interface?

protected Map<Object, Object> context;
protected Iterable<ContentStream> streams;
protected Map<String, Object> json;
protected String userPrincipalName = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I investigated why we had to preserve this here when only one class uses it and:

DocExpirationUpdateProcessorFactory is the ONLY built-in component that:

  1. Creates background/scheduled requests (not triggered by HTTP)
  2. Needs authentication (because it makes distributed deletes)
  3. Must identify itself as a node-initiated operation

Other internal requests either:

  • Don't need authentication (single-node operations)
  • Are triggered by user requests (already have principal from HTTP)
  • Use different mechanisms (like HTTP client with PKI headers for inter-node communication)

This is why setUserPrincipalName() exists but is rarely used - it's a special-purpose API for a rare use case!

I wondered about another home for this, or how do we handle secure internode elsewhere...? Any ideas?


/**
* Utility method to build SolrParams from individual query components. This is a convenience
* method for legacy code that needs to construct params from separate query, qtype, start, limit,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

how strongly do we want to eliminate this pattern? Actually, on more investigation, it's only used by five classes, though 27 times!

@Override
public IndexSchema getSchema() {
// a request for a core admin will no have a core
// a request for a core admin will not have a core
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure what this comment is telling us..

Copy link
Contributor

Choose a reason for hiding this comment

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

getCore() and getSchema() here (maybe more) are only applicable to requests to a core. Node requests will return null.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this spot here is the right spot for such a comment. For one thing; this "Base" class implements an interface, so if something about this is to be said, it should be there.

*
* @see PKIAuthenticationPlugin#NODE_IS_USER
* @see #getUserPrincipal
* @lucene.internal
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these tags are copied over from oroginal implementation. Not sure what they mean or why we have them at this point. If there was a better more "supported" way to do this, I'd love to hear about it!


assertU("<optimize/>");

// test query
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These tests are covered by other unit tests that do the same thing. So removed to pare this massive file back.

@epugh epugh changed the title SOLR-18038: Remove deprecated LocalSolrQueryRequest and just us SolrQueryRequestBase SOLR-18038: Remove deprecated LocalSolrQueryRequest and use SolrQueryRequestBase Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the deprecated LocalSolrQueryRequest by making SolrQueryRequestBase instantiable and migrating production code + tests to use it, including some cleanup of legacy parameter-building patterns.

Changes:

  • Make SolrQueryRequestBase concrete and move functionality previously unique to LocalSolrQueryRequest into it; delete LocalSolrQueryRequest.
  • Update many modules/tests to construct requests using SolrQueryRequestBase, frequently switching from NamedList to ModifiableSolrParams.
  • Minor test refactors/cleanups (imports, signatures, small comment tweaks).

Reviewed changes

Copilot reviewed 80 out of 80 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
solr/test-framework/src/java/org/apache/solr/util/TestHarness.java Adds a helper to build SolrParams for legacy “six-parameter” request construction; updates factory to use SolrQueryRequestBase.
solr/test-framework/src/java/org/apache/solr/update/processor/UpdateProcessorTestBase.java Migrates request creation from LocalSolrQueryRequest to SolrQueryRequestBase.
solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java Uses SolrQueryRequestBase in helpers that previously returned LocalSolrQueryRequest.
solr/solrj/src/test/org/apache/solr/client/solrj/routing/ReplicaListTransformerTest.java Updates test request instantiation; minor method signature cleanup.
solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java Removes unnecessary checked exceptions/imports in tests.
solr/modules/scripting/src/test/org/apache/solr/scripting/xslt/XSLTUpdateRequestHandlerTest.java Migrates request creation to SolrQueryRequestBase.
solr/modules/scripting/src/java/org/apache/solr/scripting/update/ScriptUpdateProcessorFactory.java Uses SolrQueryRequestBase for local init validation request.
solr/modules/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java Migrates test request creation to SolrQueryRequestBase.
solr/modules/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java Switches request param construction from NamedList to ModifiableSolrParams and SolrQueryRequestBase.
solr/modules/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTestAbstract.java Adjusts casts/types to SolrQueryRequestBase for request handling in tests.
solr/modules/cross-dc/src/test/org/apache/solr/crossdc/handler/MirroringConfigSetsHandlerTest.java Uses SolrQueryRequestBase for test request creation.
solr/modules/cross-dc/src/test/org/apache/solr/crossdc/handler/MirroringCollectionsHandlerTest.java Uses SolrQueryRequestBase for test request creation.
solr/modules/cross-dc/src/java/org/apache/solr/crossdc/handler/MirroringConfigSetsHandler.java Wraps requests using SolrQueryRequestBase instead of LocalSolrQueryRequest.
solr/modules/clustering/src/test/org/apache/solr/handler/clustering/ClusteringComponentTest.java Migrates requests in tests to SolrQueryRequestBase.
solr/modules/clustering/src/java/org/apache/solr/handler/clustering/ClusteringComponent.java Replaces legacy arg-map request construction with ModifiableSolrParams + SolrQueryRequestBase.
solr/core/src/test/org/apache/solr/update/processor/UUIDUpdateProcessorFallbackTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/update/processor/TemplateUpdateProcessorTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/update/processor/SkipExistingDocumentsProcessorFactoryTest.java Moves request params from NamedList to ModifiableSolrParams and uses SolrQueryRequestBase.
solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactoryTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/update/processor/DistributedUpdateProcessorTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/update/processor/DefaultValueUpdateProcessorTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java Updates test request types/creation to SolrQueryRequestBase.
solr/core/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/update/AddBlockUpdateTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/security/TestPKIAuthenticationPlugin.java Updates test request type; introduces a poorly named variable that shadows the class.
solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java Updates commented-out legacy snippet to SolrQueryRequestBase.
solr/core/src/test/org/apache/solr/search/SignificantTermsQParserPluginTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/schema/IndexSchemaRuntimeFieldTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/schema/ChangedSchemaMergeTest.java Uses SolrQueryRequestBase in tests; replaces NamedList request params.
solr/core/src/test/org/apache/solr/response/TestPushWriter.java Uses SolrQueryRequestBase in writer tests.
solr/core/src/test/org/apache/solr/response/TestJavaBinResponseWriter.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/response/SmileWriterTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/request/TestSolrRequestInfo.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/handler/component/MoreLikeThisComponentTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/handler/admin/api/V2NodeAPIMappingTest.java Reworks param capture to use ModifiableSolrParams + SolrQueryRequestBase.
solr/core/src/test/org/apache/solr/handler/admin/V2ApiMappingTest.java Updates request instantiation for mapping tests to SolrQueryRequestBase.
solr/core/src/test/org/apache/solr/handler/admin/TestCollectionAPIs.java Updates request instantiation but drops getHttpMethod() behavior needed by BaseHandlerApiSupport.
solr/core/src/test/org/apache/solr/handler/admin/TestApiFramework.java Uses SolrQueryRequestBase for API-framework tests.
solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/handler/admin/SecurityConfHandlerTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/handler/V2UpdateAPIMappingTest.java Uses SolrQueryRequestBase for update API mapping tests.
solr/core/src/test/org/apache/solr/handler/V2ClusterAPIMappingTest.java Uses SolrQueryRequestBase for cluster API mapping tests.
solr/core/src/test/org/apache/solr/handler/TestCSVLoader.java Uses SolrQueryRequestBase in tests; minor formatting.
solr/core/src/test/org/apache/solr/handler/RequestHandlerBaseTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/handler/FieldAnalysisRequestHandlerTest.java Uses SolrQueryRequestBase in tests.
solr/core/src/test/org/apache/solr/core/TestLazyCores.java Returns SolrQueryRequestBase from helper methods in tests.
solr/core/src/test/org/apache/solr/TestCrossCoreJoin.java Replaces 6-arg request ctor usage with explicit ModifiableSolrParams + SolrQueryRequestBase.
solr/core/src/test/org/apache/solr/ConvertedLegacyTest.java Migrates legacy request construction to TestHarness.makeParams(...) + SolrQueryRequestBase.
solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java Updates request creation to SolrQueryRequestBase; minor comment tweak.
solr/core/src/java/org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.java Uses SolrQueryRequestBase for internal periodic work; minor comment fixes.
solr/core/src/java/org/apache/solr/update/UpdateLog.java Uses SolrQueryRequestBase for internal update-log operations.
solr/core/src/java/org/apache/solr/update/PeerSync.java Uses SolrQueryRequestBase for internal requests during peer sync.
solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java Uses SolrQueryRequestBase for internal request context.
solr/core/src/java/org/apache/solr/update/CommitTracker.java Uses SolrQueryRequestBase for internal commit execution.
solr/core/src/java/org/apache/solr/search/join/ScoreJoinQParserPlugin.java Uses SolrQueryRequestBase for cross-core parsing request.
solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java Uses SolrQueryRequestBase for cross-core parsing request.
solr/core/src/java/org/apache/solr/schema/IndexSchema.java Uses SolrQueryRequestBase for schema XML writing request context.
solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java Made concrete; adds principal-name plumbing; removes deprecated LocalSolrQueryRequest dependency.
solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java Small signature/style cleanup in interface (remove redundant public).
solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java Deleted (deprecated class removal).
solr/core/src/java/org/apache/solr/handler/designer/DefaultSampleDocumentsLoader.java Removes trivial CSVRequest subclass; uses SolrQueryRequestBase directly.
solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java Uses SolrQueryRequestBase for transformer factory request.
solr/core/src/java/org/apache/solr/handler/admin/api/UpgradeCoreIndex.java Uses SolrQueryRequestBase for internal commit/reindex operations.
solr/core/src/java/org/apache/solr/handler/admin/api/MergeIndexes.java Wraps request with SolrQueryRequestBase when invoking update chain.
solr/core/src/java/org/apache/solr/handler/admin/SplitOp.java Uses SolrQueryRequestBase for split requests.
solr/core/src/java/org/apache/solr/handler/IndexFetcher.java Uses SolrQueryRequestBase for internal commit requests.
solr/core/src/java/org/apache/solr/core/CoreContainer.java Uses SolrQueryRequestBase for internal commit during reload/read-only transitions.
solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java Uses SolrQueryRequestBase for internal commit-and-switch operations.
solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java Uses SolrQueryRequestBase for internal commits during recovery.
solr/core/src/java/org/apache/solr/api/Api.java Minor doc grammar cleanup.
Comments suppressed due to low confidence (1)

solr/core/src/test/org/apache/solr/security/TestPKIAuthenticationPlugin.java:97

  • The variable name SolrQueryRequestBase shadows the SolrQueryRequestBase type and violates usual lowerCamelCase conventions. This is easy to misread and can confuse IDE navigation; rename it to something like localReq / testReq / solrRequest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 35 to 38
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.security.PKIAuthenticationPlugin;
import org.apache.solr.util.RTimerTree;
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

PKIAuthenticationPlugin is imported but only referenced in Javadoc. If the build enforces no-unused-imports (common with Checkstyle/Spotless), this will fail. Either remove the import and fully-qualify it in the @see, or reference the class in code.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks

Comment on lines 150 to 167
@@ -163,16 +163,32 @@ public List<CommandOperation> getCommands(boolean validateInput) {
public Map<String, String> getPathTemplateValues() {
return parts;
}

@Override
public String getHttpMethod() {
return method.toString();
}
};
api.call(req, rsp);
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

This test request no longer overrides getHttpMethod() and also doesn't populate req.getContext().put("httpMethod", ...). Since SolrQueryRequest#getHttpMethod()'s default implementation reads and casts the httpMethod context entry, BaseHandlerApiSupport will hit an NPE when it calls req.getHttpMethod(). Set req.getContext().put("httpMethod", method) (where method is the SolrRequest.METHOD enum) or add back a getHttpMethod() override.

Copilot uses AI. Check for mistakes.
Comment on lines 171 to 190
private SolrQueryRequestBase createTestRequest(
SolrParams params,
Map<String, String> pathTemplateValues,
String httpMethod,
String requestBody,
Api api) {
return new SolrQueryRequestBase(null, params) {
@Override
public List<CommandOperation> getCommands(boolean validateInput) {
if (requestBody == null) return Collections.emptyList();
return ApiBag.getCommandOperations(
new ContentStreamBase.StringStream(requestBody), api.getCommandSchema(), true);
}

@Override
public Map<String, String> getPathTemplateValues() {
return pathTemplateValues;
}
};
}
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

createTestRequest(...) is unused, and it has an unused parameter (httpMethod). Either remove this helper entirely or refactor makeCall(...) to use it (and ensure it sets the request context/overrides needed for getHttpMethod() as well).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks

@epugh
Copy link
Contributor Author

epugh commented Feb 7, 2026

Okay, I think this is ready for review and hopefully merging. The one big thing is do we continue to call this SolrQueryRequestBase that implements SolrQueryRequest? We could always rename in another method too. I think this is a candidate to go to main and branch_10x.

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

Thanks...
just some small feedback

@Override
public IndexSchema getSchema() {
// a request for a core admin will no have a core
// a request for a core admin will not have a core
Copy link
Contributor

Choose a reason for hiding this comment

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

getCore() and getSchema() here (maybe more) are only applicable to requests to a core. Node requests will return null.

@Override
public IndexSchema getSchema() {
// a request for a core admin will no have a core
// a request for a core admin will not have a core
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this spot here is the right spot for such a comment. For one thing; this "Base" class implements an interface, so if something about this is to be said, it should be there.

return captureConvertedV1Request(path, method, v2RequestBody).getParams();
}

protected SolrParams captureConvertedV1Params(
Copy link
Contributor

Choose a reason for hiding this comment

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

what happened here?

Comment on lines 454 to 466
@@ -434,7 +463,7 @@ public LocalSolrQueryRequest makeRequest(String... q) {
@SuppressWarnings({"rawtypes"})
NamedList nl = new NamedList(entries);
if (nl.get("wt") == null) nl.add("wt", "xml");
return new LocalSolrQueryRequest(TestHarness.this.getCore(), nl);
return new SolrQueryRequestBase(TestHarness.this.getCore(), nl.toSolrParams());
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny scope creep request: remove most of these lines with a simple call to SolrTestCaseJ4.params(q). No need for the NamedList

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good eye! I didn't know about that.

@dsmiley
Copy link
Contributor

dsmiley commented Feb 7, 2026

do we continue to call this SolrQueryRequestBase that implements SolrQueryRequest

Versus what? Maybe you mean, do we need the interface vs pervasive class that's used basically everywhere? Yeah. That'd be a major version change though.

@epugh
Copy link
Contributor Author

epugh commented Feb 12, 2026

I am going to update this branch to the latest from main, and look to commit it later today. Please speak up if we need to do other changes.

@epugh epugh merged commit f93ff95 into apache:main Feb 12, 2026
6 of 7 checks passed
Comment on lines +422 to +430
Map<String, String[]> map = new HashMap<>();
for (Map.Entry<String, String> e : args.entrySet()) {
map.put(e.getKey(), new String[] {e.getValue()});
}
if (q[0] != null) map.put(CommonParams.Q, new String[] {q[0]});
if (qtype != null) map.put(CommonParams.QT, new String[] {qtype});
map.put(CommonParams.START, new String[] {Integer.toString(start)});
map.put(CommonParams.ROWS, new String[] {Integer.toString(limit)});
return new SolrQueryRequestBase(TestHarness.this.getCore(), new MultiMapSolrParams(map));
Copy link
Contributor

Choose a reason for hiding this comment

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

ugh; no. You can probably simply tell Claude to use ModifiableSolrParams without creating a new HashMap, and it can probably simplify it a lot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep!

NamedList nl = new NamedList(entries);
if (nl.get("wt") == null) nl.add("wt", "xml");
return new LocalSolrQueryRequest(TestHarness.this.getCore(), nl);
return new SolrQueryRequestBase(TestHarness.this.getCore(), SolrTestCaseJ4.params(q));
Copy link
Contributor

Choose a reason for hiding this comment

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

This change appears to ignore args. Don't we have to combine them? Like to consider wt, for example.

See org.apache.solr.common.params.SolrParams#wrapDefaults to combine 2.

Consider taking this feedback holistically with my other comment in this method -- produce a SolrParams of args. And then produce another SolrParams of q. And combine with wrapDefaults, returning from this method in exactly one spot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dug a bit, and actually we deal with the args a bit furthur up on line 425 where we iterate over the args populating the map.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ended up refactoring the method to clean it up and make it easier to reason about.

@SuppressWarnings({"unchecked"})
public LocalSolrQueryRequest makeRequest(String... q) {
public SolrQueryRequestBase makeRequest(String... q) {
args.computeIfAbsent("wt", k -> "xml");
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a side-effect, which is unfortunate (it pre-existed, I know). I wonder if we could simply initialize args with it so we don't manipulate args here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I also started looking at if we could just eliminate args in favour of just passing in all the params here...

epugh added a commit that referenced this pull request Feb 12, 2026
@epugh
Copy link
Contributor Author

epugh commented Feb 13, 2026

The work in this PR is continued in #4131.

epugh added a commit that referenced this pull request Feb 14, 2026
…RequestBase (#4101)

Migrate from LocalSolrQueryRequest to SolrQueryRequestBase by making SolrQueryRequestBase no longer abstract and including all functionality previously unique to LocalSolrQueryRequest

(cherry picked from commit f93ff95)
epugh added a commit that referenced this pull request Feb 14, 2026
…RequestBase (#4101)

Migrate from LocalSolrQueryRequest to SolrQueryRequestBase by making SolrQueryRequestBase no longer abstract and including all functionality previously unique to LocalSolrQueryRequest

(cherry picked from commit f93ff95)
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