Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter limit: System.UriFormatException: Invalid URI: The Uri string is too long #581

Open
ChrisMares opened this issue Feb 9, 2022 · 5 comments

Comments

@ChrisMares
Copy link

ChrisMares commented Feb 9, 2022

Using .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:
#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.

@mausch
Copy link
Member

mausch commented Feb 17, 2022

Hi, so if understand correctly this is a duplicate of #524 ?

@ChrisMares
Copy link
Author

Thanks @mausch, #524 is more of a workaround because I'm having to use synchronous calls to get it to work.

I was just wondering if there was a way to tell solrNet to do a POST to solr instead of a GET by default? How would I do that?

@mausch
Copy link
Member

mausch commented Feb 21, 2022

This recent fix should address your problem #583

@ChrisMares
Copy link
Author

@mausch Thank you very much! I see your nuget packages have not been updated since 2019, do most people pull source code in their projects and run that way? Is there a nuget that gets created when you merge to master branch?

@mausch
Copy link
Member

mausch commented Feb 28, 2022

Is there a nuget that gets created when you merge to master branch?

Yep see https://github.com/orgs/SolrNet/packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants