ElasticSearch Nest 5.0.1 抛出以下异常,当从 Droid 项目调用时,从单元测试一切正常
ElasticSearch Nest 5.0.1 throwing below exception, when called from Droid project, From Unit test everything works fine
我正在 NetStandard 项目中使用 Nest 5.0.1 开发 Xamarin Android。
搜索 api 是从可移植项目中调用的。
通过单元测试调用任何嵌套搜索时 api。它工作正常。
但是当相同的 api 通过 Droid 项目时出现以下错误。
var connectionPool = new SingleNodeConnectionPool( new Uri( "http://localhost:9200" ) );
SearchSettings = new ConnectionSettings( connectionPool, new HttpConnection()).DefaultIndex( "test-index" );
SearchClient = new ElasticClient( SearchSettings );
谁能帮忙,缺什么。我确保 System.Net.Http 出现在 Portable 和 Droid 项目中。
# Audit exception in step 1 BadRequest:
System.NotImplementedException: The method or operation is not implemented.
at System.Net.Http.HttpClientHandler.set_MaxConnectionsPerServer (System.Int32 value) [0x00000] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:427
at Elasticsearch.Net.HttpConnection.CreateHttpClientHandler (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:108
at Elasticsearch.Net.HttpConnection+<>c__DisplayClass2_0.<GetClient>b__0 (System.Int32 h) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:47
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00037] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1049
at Elasticsearch.Net.HttpConnection.GetClient (Elasticsearch.Net.RequestData requestData) [0x00042] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:45
at Elasticsearch.Net.HttpConnection.Request[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:64
at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00023] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:400
# Inner Exception: The method or operation is not implemented.
System.NotImplementedException: The method or operation is not implemented.
at System.Net.Http.HttpClientHandler.set_MaxConnectionsPerServer (System.Int32 value) [0x00000] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:427
at Elasticsearch.Net.HttpConnection.CreateHttpClientHandler (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:108
at Elasticsearch.Net.HttpConnection+<>c__DisplayClass2_0.<GetClient>b__0 (System.Int32 h) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:47
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00037] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1049
at Elasticsearch.Net.HttpConnection.GetClient (Elasticsearch.Net.RequestData requestData) [0x00042] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:45
at Elasticsearch.Net.HttpConnection.Request[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:64
at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00023] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:400
# Exception:
Elasticsearch.Net.UnexpectedElasticsearchClientException: The method or operation is not implemented. ---> System.NotImplementedException: The method or operation is not implemented.
at System.Net.Http.HttpClientHandler.set_MaxConnectionsPerServer (System.Int32 value) [0x00000] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:427
at Elasticsearch.Net.HttpConnection.CreateHttpClientHandler (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:108
at Elasticsearch.Net.HttpConnection+<>c__DisplayClass2_0.<GetClient>b__0 (System.Int32 h) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:47
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00037] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1049
at Elasticsearch.Net.HttpConnection.GetClient (Elasticsearch.Net.RequestData requestData) [0x00042] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:45
at Elasticsearch.Net.HttpConnection.Request[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:64
at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00023] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:400
--- End of inner exception stack trace ---
这是一个错误,已由 ElasticSearch 团队解决。
我必须做的一件事是 ConnectionSettings 上的 .ConnectionLimit(-1)。
供参考:https://github.com/elastic/elasticsearch-net/issues/2590
我正在 NetStandard 项目中使用 Nest 5.0.1 开发 Xamarin Android。
搜索 api 是从可移植项目中调用的。
通过单元测试调用任何嵌套搜索时 api。它工作正常。 但是当相同的 api 通过 Droid 项目时出现以下错误。
var connectionPool = new SingleNodeConnectionPool( new Uri( "http://localhost:9200" ) );
SearchSettings = new ConnectionSettings( connectionPool, new HttpConnection()).DefaultIndex( "test-index" );
SearchClient = new ElasticClient( SearchSettings );
谁能帮忙,缺什么。我确保 System.Net.Http 出现在 Portable 和 Droid 项目中。
# Audit exception in step 1 BadRequest:
System.NotImplementedException: The method or operation is not implemented.
at System.Net.Http.HttpClientHandler.set_MaxConnectionsPerServer (System.Int32 value) [0x00000] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:427
at Elasticsearch.Net.HttpConnection.CreateHttpClientHandler (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:108
at Elasticsearch.Net.HttpConnection+<>c__DisplayClass2_0.<GetClient>b__0 (System.Int32 h) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:47
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00037] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1049
at Elasticsearch.Net.HttpConnection.GetClient (Elasticsearch.Net.RequestData requestData) [0x00042] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:45
at Elasticsearch.Net.HttpConnection.Request[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:64
at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00023] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:400
# Inner Exception: The method or operation is not implemented.
System.NotImplementedException: The method or operation is not implemented.
at System.Net.Http.HttpClientHandler.set_MaxConnectionsPerServer (System.Int32 value) [0x00000] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:427
at Elasticsearch.Net.HttpConnection.CreateHttpClientHandler (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:108
at Elasticsearch.Net.HttpConnection+<>c__DisplayClass2_0.<GetClient>b__0 (System.Int32 h) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:47
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00037] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1049
at Elasticsearch.Net.HttpConnection.GetClient (Elasticsearch.Net.RequestData requestData) [0x00042] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:45
at Elasticsearch.Net.HttpConnection.Request[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:64
at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00023] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:400
# Exception:
Elasticsearch.Net.UnexpectedElasticsearchClientException: The method or operation is not implemented. ---> System.NotImplementedException: The method or operation is not implemented.
at System.Net.Http.HttpClientHandler.set_MaxConnectionsPerServer (System.Int32 value) [0x00000] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:427
at Elasticsearch.Net.HttpConnection.CreateHttpClientHandler (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:108
at Elasticsearch.Net.HttpConnection+<>c__DisplayClass2_0.<GetClient>b__0 (System.Int32 h) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:47
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00037] in /Users/builder/data/lanes/4009/72366f70/source/mono/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1049
at Elasticsearch.Net.HttpConnection.GetClient (Elasticsearch.Net.RequestData requestData) [0x00042] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:45
at Elasticsearch.Net.HttpConnection.Request[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00000] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:64
at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TReturn] (Elasticsearch.Net.RequestData requestData) [0x00023] in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:400
--- End of inner exception stack trace ---
这是一个错误,已由 ElasticSearch 团队解决。
我必须做的一件事是 ConnectionSettings 上的 .ConnectionLimit(-1)。
供参考:https://github.com/elastic/elasticsearch-net/issues/2590