title: Nest (Elasticsearch client for C#) Bulk Index
body: <p>Noob at <code>ElasticSearch</code> and Nest here. Not exactly sure what I am doing wrong here, but this code throws up <br></p>
  
  <blockquote>
    <p>"Malformed action/metadata line [1], expected START_OBJECT or END_OBJECT but found [VALUE_NUMBER]". </p>
  </blockquote>
  
  <p>I know ES is throwing this error because <code>JSON is malformed</code>. What I don't know is why Nest isn't generating the right JSON?</p>
  
  <p>Note: I want to be able to do a bulk index operation while telling it which index and type this payload should go to. </p>
  
  <pre><code>public class Test
  {
      private static Uri _node;
      private ElasticsearchClient _client;
  
      static Test()
      {
          _node = new Uri("http://localhost:9200");
      }
  
      public Test()
      {
          _client = new ElasticsearchClient(new ConnectionSettings(_node));
      }
  
      public void Bulk&lt;T&gt;(List&lt;T&gt; data, string index, string type) where T : class
      {
          _client.Bulk(index, type, data);
      }
  }
  </code></pre>