Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dcd5737
Convert abstract SolrQueryResposneBase into regular class that can be…
epugh Feb 4, 2026
87246ba
Mass conversion of LSQR to SQRB
epugh Feb 4, 2026
41c25c6
Remove LocalSolrQueryRequest
epugh Feb 4, 2026
f638d50
Trival class can be removed now that SolrQueryRequestBase isn't abstract
epugh Feb 4, 2026
9010feb
Need fewer anonymous inner classes than we thought!
epugh Feb 4, 2026
7ffe95f
lint
epugh Feb 4, 2026
a924781
typos
epugh Feb 4, 2026
a39810e
Small code style fixes.
epugh Feb 4, 2026
7060092
Reviewing code again, make LocalPrincipal a record.
epugh Feb 4, 2026
55ca435
Eliminate makeParams where possible, and relocate method to TestHarness
epugh Feb 4, 2026
4e63c05
lint
epugh Feb 4, 2026
df7c02d
Merge remote-tracking branch 'upstream/main' into SOLR-18038-v2
epugh Feb 4, 2026
05b3448
sync with latest code
epugh Feb 4, 2026
969501f
add changelog
epugh Feb 4, 2026
b79135f
More updates needed
epugh Feb 4, 2026
7c68219
Update solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
epugh Feb 4, 2026
89260a5
remove unused code
epugh Feb 4, 2026
a521afd
Merge branch 'SOLR-18038-v2' of github.com:epugh/solr into SOLR-18038-v2
epugh Feb 4, 2026
55541d6
precommit issues that need fixing
epugh Feb 7, 2026
22a5718
Copy makeParams to the only real test using it..
epugh Feb 8, 2026
84086c3
remove extra method that is only used in one place
epugh Feb 8, 2026
1546d46
Suggestions based on feedback.
epugh Feb 8, 2026
491ac83
json is coming back pretty printed, so skip the }
epugh Feb 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog/unreleased/SOLR-18038-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
title: Remove deprecated LocalSolrQueryRequest in favour of SolrQueryRequestBase.
type: removed # added, changed, fixed, deprecated, removed, dependency_update, security, other
authors:
- name: Eric Pugh
links:
- name: SOLR-18038
url: https://issues.apache.org/jira/browse/SOLR-18038
4 changes: 2 additions & 2 deletions solr/core/src/java/org/apache/solr/api/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import org.apache.solr.response.SolrQueryResponse;

/**
* Every version 2 API must extend the this class. It's mostly like a request handler but it has
* extra methods to provide the json schema of the end point
* Every version 2 API must extend this class. It's mostly like a request handler, but it has extra
* methods to provide the json schema of the end point
*/
public abstract class Api implements SpecProvider {
protected SpecProvider spec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
import org.apache.solr.core.DirectoryFactory.DirContext;
import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.ReplicationHandler;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.update.CommitUpdateCommand;
Expand Down Expand Up @@ -689,7 +689,7 @@ public final void doSyncOrReplicateRecovery(SolrCore core) throws Exception {
syncSuccess = peerSyncWithLeader.sync(recentVersions).isSuccess();
}
if (syncSuccess) {
SolrQueryRequest req = new LocalSolrQueryRequest(core, new ModifiableSolrParams());
SolrQueryRequest req = new SolrQueryRequestBase(core, new ModifiableSolrParams());
// force open a new searcher
core.getUpdateHandler().commit(new CommitUpdateCommand(req, false));
req.close();
Expand Down Expand Up @@ -850,7 +850,7 @@ private final Future<RecoveryInfo> replay(SolrCore core)
}
if (replicaType == Replica.Type.TLOG) {
// roll over all updates during buffering to new tlog, make RTG available
SolrQueryRequest req = new LocalSolrQueryRequest(core, new ModifiableSolrParams());
SolrQueryRequest req = new SolrQueryRequestBase(core, new ModifiableSolrParams());
core.getUpdateHandler()
.getUpdateLog()
.copyOverBufferingUpdates(new CommitUpdateCommand(req, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.apache.solr.handler.IndexFetcher;
import org.apache.solr.handler.ReplicationHandler;
import org.apache.solr.handler.admin.api.ReplicationAPIBase;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.update.CommitUpdateCommand;
import org.apache.solr.update.SolrIndexWriter;
import org.apache.solr.update.UpdateLog;
Expand Down Expand Up @@ -101,7 +101,7 @@ public void startReplication(boolean switchTransactionLog) {
if (commitVersion == null) return;
if (Long.parseLong(commitVersion) == lastVersion) return;
UpdateLog updateLog = solrCore.getUpdateHandler().getUpdateLog();
SolrQueryRequest req = new LocalSolrQueryRequest(core, new ModifiableSolrParams());
SolrQueryRequest req = new SolrQueryRequestBase(core, new ModifiableSolrParams());
CommitUpdateCommand cuc = new CommitUpdateCommand(req, false);
cuc.setVersion(Long.parseLong(commitVersion));
updateLog.commitAndSwitchToNewTlog(cuc);
Expand Down
4 changes: 2 additions & 2 deletions solr/core/src/java/org/apache/solr/core/CoreContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
import org.apache.solr.metrics.SolrMetricsContext;
import org.apache.solr.metrics.otel.OtelUnit;
import org.apache.solr.pkg.SolrPackageLoader;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.request.SolrRequestInfo;
import org.apache.solr.search.CacheConfig;
Expand Down Expand Up @@ -1977,7 +1977,7 @@ public void reload(String name, UUID coreId) {

// force commit on old core if the new one is readOnly and prevent any new updates
if (newCore.readOnly) {
SolrQueryRequest req = new LocalSolrQueryRequest(core, new ModifiableSolrParams());
SolrQueryRequest req = new SolrQueryRequestBase(core, new ModifiableSolrParams());
core.getUpdateHandler().commit(CommitUpdateCommand.closeOnCommit(req, false));
}

Expand Down
4 changes: 2 additions & 2 deletions solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@
import org.apache.solr.core.IndexDeletionPolicyWrapper;
import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.admin.api.ReplicationAPIBase;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.security.AllowListUrlChecker;
import org.apache.solr.update.CommitUpdateCommand;
Expand Down Expand Up @@ -540,7 +540,7 @@ IndexFetchResult fetchLatestIndex(boolean forceReplication, boolean forceCoreRel
if (skipCommitOnLeaderVersionZero || solrCore.readOnly) {
openNewSearcherAndUpdateCommitPoint();
} else {
SolrQueryRequest req = new LocalSolrQueryRequest(solrCore, new ModifiableSolrParams());
SolrQueryRequest req = new SolrQueryRequestBase(solrCore, new ModifiableSolrParams());
solrCore.getUpdateHandler().commit(new CommitUpdateCommand(req, false));
}
}
Expand Down
4 changes: 2 additions & 2 deletions solr/core/src/java/org/apache/solr/handler/admin/SplitOp.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
import org.apache.solr.common.params.CoreAdminParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.core.SolrCore;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.update.SolrIndexSplitter;
import org.apache.solr.update.SplitIndexCommand;
Expand Down Expand Up @@ -201,7 +201,7 @@ public void execute(CoreAdminHandler.CallInfo it) throws Exception {
paths = Arrays.asList(pathsArr);
}

req = new LocalSolrQueryRequest(parentCore, params);
req = new SolrQueryRequestBase(parentCore, params);

SplitIndexCommand cmd =
new SplitIndexCommand(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.admin.CoreAdminHandler;
import org.apache.solr.jersey.PermissionName;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.security.PermissionNameProvider;
Expand Down Expand Up @@ -169,7 +169,7 @@ public SolrJerseyResponse mergeIndexes(String coreName, MergeIndexesRequestBody

UpdateRequestProcessorChain processorChain =
core.getUpdateProcessingChain(requestBody.updateChain);
wrappedReq = new LocalSolrQueryRequest(core, req.getParams());
wrappedReq = new SolrQueryRequestBase(core, req.getParams());
UpdateRequestProcessor processor = processorChain.createProcessor(wrappedReq, rsp);
processor.processMergeIndexes(new MergeIndexesCommand(readers, req));
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
import org.apache.solr.handler.RequestHandlerBase;
import org.apache.solr.handler.admin.CoreAdminHandler;
import org.apache.solr.index.LatestVersionMergePolicy;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.schema.IndexSchema;
Expand Down Expand Up @@ -95,7 +95,7 @@ public class UpgradeCoreIndex extends CoreAdminAPIBase {
public enum CoreIndexUpgradeStatus {
UPGRADE_SUCCESSFUL,
ERROR,
NO_UPGRADE_NEEDED;
NO_UPGRADE_NEEDED
}

private static final int RETRY_COUNT_FOR_SEGMENT_DELETION = 5;
Expand Down Expand Up @@ -377,7 +377,7 @@ private boolean isIndexUpgraded(SolrCore core) throws IOException {
}

private void doCommit(SolrCore core) throws IOException {
try (LocalSolrQueryRequest req = new LocalSolrQueryRequest(core, new ModifiableSolrParams())) {
try (SolrQueryRequestBase req = new SolrQueryRequestBase(core, new ModifiableSolrParams())) {
CommitUpdateCommand cmd = new CommitUpdateCommand(req, false); // optimize=false
core.getUpdateHandler().commit(cmd);
} catch (IOException ioEx) {
Expand All @@ -404,8 +404,8 @@ private void processSegment(
// Exclude copy field targets to avoid duplicating values on reindex
Set<String> nonStoredDVFields = docFetcher.getNonStoredDVsWithoutCopyTargets();

try (LocalSolrQueryRequest solrRequest =
new LocalSolrQueryRequest(core, new ModifiableSolrParams())) {
try (SolrQueryRequestBase solrRequest =
new SolrQueryRequestBase(core, new ModifiableSolrParams())) {
SolrQueryResponse rsp = new SolrQueryResponse();
UpdateRequestProcessor processor = processorChain.createProcessor(solrRequest, rsp);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.StrUtils;
import org.apache.solr.core.SolrCore;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.response.ResultContext;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.response.transform.DocTransformer;
Expand Down Expand Up @@ -859,7 +859,7 @@ private static SolrReturnFields makeReturnFields(
if (resolution == Resolution.ROOT_WITH_CHILDREN
&& core.getLatestSchema().isUsableForChildDocs()) {
SolrParams params = new ModifiableSolrParams().set("limit", "-1");
try (LocalSolrQueryRequest req = new LocalSolrQueryRequest(core, params)) {
try (SolrQueryRequestBase req = new SolrQueryRequestBase(core, params)) {
docTransformer = core.getTransformerFactory("child").create(null, params, req);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ protected List<SolrInputDocument> loadCsvDocs(
} 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!

return (new SampleCSVLoader(new SolrQueryRequestBase(null, params), maxDocsToLoad))
.loadDocs(stream);
}

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -333,19 +334,13 @@ private static class NoOpUpdateRequestProcessor extends UpdateRequestProcessor {
}
}

private static class CSVRequest extends SolrQueryRequestBase {
CSVRequest(SolrParams params) {
super(null, params);
}
}

private static class SampleCSVLoader extends CSVLoaderBase {
List<SolrInputDocument> docs = new ArrayList<>();
CSVRequest req;
SolrQueryRequestBase req;
int maxDocsToLoad;
String multiValueDelimiter;

SampleCSVLoader(CSVRequest req, int maxDocsToLoad) {
SampleCSVLoader(SolrQueryRequestBase req, int maxDocsToLoad) {
super(req, new NoOpUpdateRequestProcessor());
this.req = req;
this.maxDocsToLoad = maxDocsToLoad;
Expand Down
112 changes: 0 additions & 112 deletions solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public interface SolrQueryRequest extends AutoCloseable {
/** This is the system property for {@link #ALLOW_PARTIAL_RESULTS_DEFAULT} */
String SOLR_ALLOW_PARTIAL_RESULTS_DEFAULT = "solr.allowPartialResultsDefault";

// silly getBoolean doesn't take a default.
/**
* Users can set {@link SolrQueryRequest#SOLR_ALLOW_PARTIAL_RESULTS_DEFAULT} system property to
* true, and solr will omit results when any shard fails due query execution limits (time, cpu
Expand Down Expand Up @@ -122,13 +121,13 @@ static boolean disallowPartialResults(SolrParams params) {
SolrCore getCore();

/** The schema snapshot from core.getLatestSchema() at request creation. */
public IndexSchema getSchema();
IndexSchema getSchema();

/** Replaces the current schema snapshot with the latest from the core. */
public void updateSchemaToLatest();
void updateSchemaToLatest();

/** Returns a string representing all the important parameters. Suitable for logging. */
public String getParamString();
String getParamString();

/**
* Returns any associated JSON (or null if none) in deserialized generic form. Java classes used
Expand Down
Loading