From dc695a8eda8163c065538c41a2f1058dabfc0c9b Mon Sep 17 00:00:00 2001 From: lukapor Date: Mon, 14 Oct 2013 16:57:32 +0200 Subject: [PATCH 1/3] Adding SearchDescriptor in MultiSearchDescriptor --- src/Nest/DSL/MultiSearchDescriptor.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Nest/DSL/MultiSearchDescriptor.cs b/src/Nest/DSL/MultiSearchDescriptor.cs index 6abb32ec74b..95e5a978156 100644 --- a/src/Nest/DSL/MultiSearchDescriptor.cs +++ b/src/Nest/DSL/MultiSearchDescriptor.cs @@ -17,6 +17,15 @@ public class MultiSearchDescriptor [JsonConverter(typeof(DictionaryKeysAreNotPropertyNamesJsonConverter))] internal IDictionary _Operations = new Dictionary(); + public MultiSearchDescriptor Search(string name, SearchDescriptorBase searchDescriptorBase) + { + name.ThrowIfNull("name"); + if (searchDescriptorBase == null) + return this; + this._Operations.Add(name, searchDescriptorBase); + return this; + } + public MultiSearchDescriptor Search(string name, Func, SearchDescriptor> searchSelector) where T : class { name.ThrowIfNull("name"); From d1b81af48b5d0d0559c6dee53325a5c226b749ee Mon Sep 17 00:00:00 2001 From: lukapor Date: Tue, 15 Oct 2013 13:52:41 +0200 Subject: [PATCH 2/3] revert --- src/Nest/DSL/MultiSearchDescriptor.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/Nest/DSL/MultiSearchDescriptor.cs b/src/Nest/DSL/MultiSearchDescriptor.cs index 95e5a978156..6abb32ec74b 100644 --- a/src/Nest/DSL/MultiSearchDescriptor.cs +++ b/src/Nest/DSL/MultiSearchDescriptor.cs @@ -17,15 +17,6 @@ public class MultiSearchDescriptor [JsonConverter(typeof(DictionaryKeysAreNotPropertyNamesJsonConverter))] internal IDictionary _Operations = new Dictionary(); - public MultiSearchDescriptor Search(string name, SearchDescriptorBase searchDescriptorBase) - { - name.ThrowIfNull("name"); - if (searchDescriptorBase == null) - return this; - this._Operations.Add(name, searchDescriptorBase); - return this; - } - public MultiSearchDescriptor Search(string name, Func, SearchDescriptor> searchSelector) where T : class { name.ThrowIfNull("name"); From 8cd56e6182b68c1973bfaadaccedeeaeaf1422d3 Mon Sep 17 00:00:00 2001 From: lukapor Date: Tue, 15 Oct 2013 14:01:50 +0200 Subject: [PATCH 3/3] pool size minimum is 1 --- src/Nest.Connection.Thrift/ThriftConnection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nest.Connection.Thrift/ThriftConnection.cs b/src/Nest.Connection.Thrift/ThriftConnection.cs index 30881468797..1d2e0238a24 100644 --- a/src/Nest.Connection.Thrift/ThriftConnection.cs +++ b/src/Nest.Connection.Thrift/ThriftConnection.cs @@ -24,7 +24,7 @@ public ThriftConnection(IConnectionSettings connectionSettings) { this._connectionSettings = connectionSettings; this._timeout = connectionSettings.Timeout; - this._poolSize = connectionSettings.MaximumAsyncConnections; + this._poolSize = Math.Max(1, connectionSettings.MaximumAsyncConnections); this._resourceLock = new Semaphore(_poolSize, _poolSize);