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

'elasticClient.Analyze' for long string throws exception #527

Closed
ArtemMironov opened this issue Mar 11, 2014 · 1 comment
Closed

'elasticClient.Analyze' for long string throws exception #527

ArtemMironov opened this issue Mar 11, 2014 · 1 comment

Comments

@ArtemMironov
Copy link

Long string for Analyze when it send to ElasticSearch as url param do not analyze by ElasticSearch and returns exception.

Steps to reproduce:

  1. execute query, where text.Length = 6300:
    var r = _client.Analyze(a => a.Text(text))

Expected Result:
r.IsValid = true
r.Tokens != null //and contains tokens

Actual Result:
r.IsValid = false
r.Tokens = null

r.ConnectionStatus =
{StatusCode: 0,
Method: GET,
Url: http://localhost:9200/_analyze?text=In%20order%20to%20see%20index%20with%20a%20single%20call%2C%20or%20even%20on%20_all%20the%20indices.In%20order%20to%20see%20the%20recovery&pretty=true,
Request: ,
Response:
ExceptionMessage: The underlying connection was closed: The connection was closed unexpectedly.
StackTrace: at System.Net.HttpWebRequest.GetResponse()
at Elasticsearch.Net.Connection.HttpConnection.DoSynchronousRequest(HttpWebRequest request, Byte[] data) in \NEST-master\NEST-master\src\Elasticsearch.Net\Connection\Connection.cs:line 190} Elasticsearch.Net.ElasticsearchResponse

It is GET request with very long url (I cut part of it from example). When I send the same request to ElasticSearch using 'Fiddler' as POST query with body all works correct.
Is there a way to send the same request via Nest?

@Mpdreamz
Copy link
Member

Thanks @ArtemMironov Analyze now favors sending the text over POST instead of GET 👍

Sorry for not responding sooner! Crazy past two months.

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