Parameter limit: System.UriFormatException: Invalid URI: The Uri string is too long
See original GitHub issueUsing .net 5
I’m using SolrQueryInList and needing to add many items, up to 1000. Currently it only lets me get to about 350 before blowing up with “Uri string too long”
After googling I found that I might need to make sure my connection to solr is a “post” instead of a “get”? If this is the cause, how do I go about doing that in my startup?
currently I have:
services.AddSolrNet<DynamicSolrItem>(SolrUrl, options =>
{
options.HttpClient.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentialsBase64);
});
What’s the correct way to make it do a post?
Also, if I use “Query” instead of “QueryAsync” I see that it is trying to use a “Post Connection”. But unfortunitly that also blows up with a 401 error. Any thoughts?
UPDATE: https://github.com/SolrNet/SolrNet/issues/524
Using the code from this issue I am now able to run the “Query” with my credentials, which in turn I am able to pass more parameters. From my research the only reason I’m able to pass more parameters is because “Query” reverts back to an old way of connecting that uses “POST” by default. This seems convoluted so I’m still wondering if there is a more “correct” way to get my normal QueryAsync stuff to call solr via POST.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
Yep see https://github.com/orgs/SolrNet/packages
This recent fix should address your problem https://github.com/SolrNet/SolrNet/pull/583