var settings = new ConnectionSettings(Constants.ElasticSearch.Node);
var client = new ElasticClient(settings);
var response = client.Search<DtoTypes.Customer.SearchResult>(s =>
s.From(0)
.Size(100000)
.Query(q => q.MatchAll()));
サイズが小さい場合に機能しますが、100,000を超えるドキュメントを持つインデックスのすべてのドキュメントを取得したいとします。制限を回避するために欠落している構成設定である必要があります。私はまた、デバッグ情報の代わりにSize()
Nest v。2.1を使用してElasticSearchですべてを照会
のTake()
を試され
"Invalid NEST response built from a unsuccesful low level call on POST: /_search\r\n# Audit trail of this API call:\r\n - BadResponse: Node: http://127.0.0.1:9200/ Took: 00:00:00.2964038\r\n# ServerError: ServerError: 500Type: search_phase_execution_exception Reason: \"all shards failed\"\r\n# OriginalException: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.\r\n at System.Net.HttpWebRequest.GetResponse()\r\n at Elasticsearch.Net.HttpConnection.Request[TReturn](RequestData requestData) in C:\users\russ\source\elasticsearch-net\src\Elasticsearch.Net\Connection\HttpConnection.cs:line 138\r\n# Request:\r\n\r\n# Response:\r\n\r\n"
デバッグ情報は、クエリ中にelasticsearch内で何かが起こっているように見えます。通常の検索APIで実行してみましたか?あなたはネストレスポンスから 'response.RequestInformation'でもクエリーを取得できるはずです – BenM
たぶん[this](http://stackoverflow.com/questions/27955623/is-there-a-way-to-retrieve -all-records-in-a-elasticsearch-nest-query)の答えが役に立ちます。 – Rob
'ConnectionSettings'で' .DisableDirectStreaming() 'を実行すると、' DebugInformation'でリクエストとレスポンスを見ることができます(_DisableDirectStreaming()を使用したいのですが、 in production_) –