From 4ad6474712b4022591a957aad0a9b388ba7d7fb7 Mon Sep 17 00:00:00 2001 From: Jakob Rasmussen Date: Fri, 28 Jun 2013 16:47:52 +0200 Subject: [PATCH] Add support to MultiGet to just have ids and indexName as params --- src/Nest/ElasticClient-MultiGet.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Nest/ElasticClient-MultiGet.cs b/src/Nest/ElasticClient-MultiGet.cs index 82a4b1574fd..29142c872f3 100644 --- a/src/Nest/ElasticClient-MultiGet.cs +++ b/src/Nest/ElasticClient-MultiGet.cs @@ -31,6 +31,24 @@ public IEnumerable MultiGet(IEnumerable ids) return this.MultiGet(ids, this.PathResolver.CreateIndexTypePath(index, typeName)); } /// + /// Gets multiple documents of T by id in the specified index + /// + public IEnumerable MultiGet(string index, IEnumerable ids) + where T : class + { + return this.MultiGet(index, ids.Select(i => Convert.ToString(i))); + } + /// + /// Gets multiple documents of T by id in the specified index + /// + public IEnumerable MultiGet(string index, IEnumerable ids) + where T : class + { + var typeName = this.GetTypeNameFor(); + + return this.MultiGet(ids, this.PathResolver.CreateIndexTypePath(index, typeName)); + } + /// /// Gets multiple documents of T by id in the specified index and the specified typename for T /// public IEnumerable MultiGet(string index, string type, IEnumerable ids)