title: How to Get a typed DTO with only some fields from Elasticsearch with Nest?
body: <p>I'm trying to <code>Get</code> a result from Elasticsearch 1.7.0 using NEST 1.7.1. My documents contain many fields, but I'm interested in only one of them. I would prefer to get a typed result representing a partial document.</p>
  
  <p>I'm using something along the lines of this code:</p>
  
  <pre><code>var settings = new ConnectionSettings(new Uri(url)).SetDefaultIndex("MyIndex");
  var client = new ElasticClient(settings);
  
  var result = client.Get&lt;MyDtoPartial&gt;(g =&gt; g
      .Type("myDocType")
      .Id("abcdefg123456")
      .Fields("doc.subids")
  );
  </code></pre>
  
  <p>Where <code>MyDtoPartial</code> currently looks like this:</p>
  
  <pre><code>public class MyDtoPartial
  {
      [JsonProperty("doc.subids")]
      public IList&lt;string&gt; SubIds { get; set; }
  
      // Other properties of my documents are not mapped, in this
      // context I only want the SubIds.
  }
  </code></pre>
  
  <p>In the debugger I can drill into <code>result.Fields</code> and see that the first in that dictionary has a value rendered by the debugger along these lines:</p>
  
  <pre class="lang-none prettyprint-override"><code>{[doc.subids, [ "12354adsf-123fasd", "2134fa34a-213123" ...
  </code></pre>
  
  <p>I can also see the Elasticsearch request that was made, which was like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>http://myserver:12345/MyIndex/myDocType/abcdefg123456?fields=doc.subids    
  </code></pre>
  
  <p>And it returns this type of json:</p>
  
  <pre><code>{
      "_index": "MyIndex",
      "_type": "myDocType",
      "_id": "abcdefg123456",
      "_version": 1,
      "found": true,
      "fields": {
          "doc.subids": ["12354adsf-123fasd",
          "2134fa34a-213123",
          "adfasdfew324-asd"]
       }
  }
  </code></pre>
  
  <p>So I have a feelling my <em>request</em> is okay, because that <em>is</em> the kind of response I'd expect.</p>
  
  <p>However, <strong>my goal was to get an instance of <code>MyDtoPartial</code> with a fully populated <code>SubIds</code> property</strong>. However, the <code>result</code> doesn't seem to contain any kind of property of type <code>MyDtoPartial</code>.</p>
  
  <p>I've gone through <a href="http://nest.azurewebsites.net/nest/core/get.html" rel="nofollow">the Nest <code>Get</code> docs</a>, which actually led to the above code.</p>
  
  <p>What is the proper way to <code>Get</code> a proper typed single document with only some fields from Elastic with Nest?</p>