Skip to content

HttpSolrClient withTheseParamNamesInTheUrl defaults - #4871

Merged
dsmiley merged 6 commits into
apache:mainfrom
dsmiley:httpSolrClientDefaultUrlParams
Sep 8, 2026
Merged

dsmiley merged 6 commits into
apache:mainfrom
dsmiley:httpSolrClientDefaultUrlParams

Conversation

@dsmiley

@dsmiley dsmiley commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

HttpSolrClient.withTheseParamNamesInTheUrl now has a default set (if you don't call it) that ensures many interesting parameters for routing or fundamental purpose end up in the URL.

HttpSolrClient.withTheseParamNamesInTheUrl now has a default set (if you don't call it) that ensures many interesting parameters for routing or fundamental purpose end up in the URL.

@dsmiley dsmiley left a comment

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 like how the tracing test, especially after I revamped it recently, shows the impacts of this change.

It may be tempting to add "command" param for replication but I recall those requests are all GET? No; some are POST so I will add.

@dsmiley dsmiley added this to the 9.x milestone Sep 3, 2026
@dsmiley

dsmiley commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Gonna merge Sunday if no feedback.

One possible consideration is, should these defaults be augmented/merged with a call to explicitly set them. I don't think I care much either way... but a benefit to not doing that is that a user can explicitly insist no params go in the URL if they want. Granted I don't know why they would care. Only one place in Solr, Distributed URP, is this called, which is to set the update distribution params. Update requests don't use any of these default params, so whatever.

@dsmiley
dsmiley merged commit 125f7c0 into apache:main Sep 8, 2026
5 of 6 checks passed
@dsmiley
dsmiley deleted the httpSolrClientDefaultUrlParams branch September 8, 2026 22:04
dsmiley added a commit that referenced this pull request Sep 9, 2026
HttpSolrClient impls now sends certain interesting request parameters in the URL query string when a POST of parameters is submitted.  In other words, withTheseParamNamesInTheUrl now has a default set. This improves observability, particularly for distributed search & admin commands.

(cherry picked from commit 125f7c0)
dsmiley added a commit that referenced this pull request Sep 9, 2026
HttpSolrClient impls now sends certain interesting request parameters in the URL query string when a POST of parameters is submitted.  In other words, withTheseParamNamesInTheUrl now has a default set.  This improves observability, particularly for distributed search & admin commands.

Backport adapted for the 9x client hierarchy: the default set and its
application land in HttpSolrClientBase (shared by Http2SolrClient /
HttpJdkSolrClient / CloudHttp2SolrClient / LBHttp2SolrClient); on main these
were merged into the HttpSolrClient base by SOLR-17968 (#3829), which is not on
branch_9x.  The deprecated Apache-HttpClient HttpSolrClient is left unchanged.

(cherry picked from commit 5c3ae79)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BtZLUe51kwP5rcZyNgE9hG
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