title: ElasticSearch NEST - all fields are NULL
body: <p>I'm trying to retrieve data from elastic search with NEST. Everything would be good, but NEST all fields return null. However, in debug mode I see that it counts the documents correctly but not showing the value of fields.</p>
  
  <p><a href="https://i.stack.imgur.com/lcwjn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lcwjn.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/xXEQj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xXEQj.png" alt="enter image description here"></a></p>
  
  <p>What I already did:</p>
  
  <ul>
  <li>checked mapping and its seems fine to me</li>
  <li>tried string query</li>
  <li>tried to get source and then read data</li>
  <li>tried <a href="https://stackoverflow.com/questions/50684934/nest-returns-null-instead-of-fields">NEST returns null instead of fields</a>
  those solution did not help either</li>
  <li>Renamed Product.cs field names to camelCase did not help either</li>
  </ul>
  
  <p>Here's my code right now</p>
  
  <pre><code>public class ElasticSearch
  {
      private ElasticClient _client;
  
      public ElasticSearch()
      {
          var node = new Uri("http://localhost:9200");
          var settings = new ConnectionSettings(node);
          settings.DefaultIndex("logsystem.logs");
          _client = new ElasticClient(settings);
      }
  
      public void searchResults()
      {
          var searchResults = _client.Search&lt;Product&gt;(s =&gt; s.AllIndices());
  
  
      }
  }
  </code></pre>
  
  <p>Product.cs</p>
  
  <pre><code>    [BsonIgnoreExtraElements]
      public class Product
      {
          [BsonId]
          [BsonIgnore]
          public ObjectId Id { get; set; }
          [Required]
          public string Name { get; set; }
          [Required]
          public string ProductLicenseKey { get; set; }
          [Required]
          public string Action { get; set; }
          [Required]
          public string ActionName { get; set; }
          [Required]
          public string MachineId { get; set; }
      }
  </code></pre>
  
  <p>Mapping in ElasticSearch:</p>
  
  <pre><code>{
  "logsystem.logs": {
      "mappings": {
          "properties": {
              "Action": {
                  "type": "text",
                  "fields": {
                      "keyword": {
                          "type": "keyword",
                          "ignore_above": 256
                      }
                  }
              },
              "ActionName": {
                  "type": "text",
                  "fields": {
                      "keyword": {
                          "type": "keyword",
                          "ignore_above": 256
                      }
                  }
              },
              "MachineId": {
                  "type": "text",
                  "fields": {
                      "keyword": {
                          "type": "keyword",
                          "ignore_above": 256
                      }
                  }
              },
              "Name": {
                  "type": "text",
                  "fields": {
                      "keyword": {
                          "type": "keyword",
                          "ignore_above": 256
                      }
                  }
              },
              "ProductLicenseKey": {
                  "type": "text",
                  "fields": {
                      "keyword": {
                          "type": "keyword",
                          "ignore_above": 256
                      }
                  }
              }
          }
      }
  }
  }
  </code></pre>
  
  <p>Maybe my mapping is not right? any answer would help. Thanks.</p>
  
  <p>EDIT ElasticSearch Documents get via postman:</p>
  
  <pre><code>{
  "took": 11,
  "timed_out": false,
  "_shards": {
      "total": 1,
      "successful": 1,
      "skipped": 0,
      "failed": 0
  },
  "hits": {
      "total": {
          "value": 6,
          "relation": "eq"
      },
      "max_score": 1.0,
      "hits": [
          {
              "_index": "logsystem.logs",
              "_type": "_doc",
              "_id": "5e5c1ca2aaa6f1245cc38895",
              "_score": 1.0,
              "_source": {
                  "Action": "Button",
                  "ActionName": "Fixed Single Generation",
                  "MachineId": "987-654-321",
                  "Name": "System",
                  "ProductLicenseKey": "123-456-789"
              }
          },
          {
              "_index": "logsystem.logs",
              "_type": "_doc",
              "_id": "5e5c1cb0aaa6f1245cc38896",
              "_score": 1.0,
              "_source": {
                  "Action": "Button",
                  "ActionName": "Fixed Multiple Generation",
                  "MachineId": "987-654-321",
                  "Name": "System",
                  "ProductLicenseKey": "123-456-789"
              }
          },
          {
              "_index": "logsystem.logs",
              "_type": "_doc",
              "_id": "5e5c1cbdaaa6f1245cc38897",
              "_score": 1.0,
              "_source": {
                  "Action": "Button",
                  "ActionName": "Trackers Single Generation",
                  "MachineId": "987-654-321",
                  "Name": "System",
                  "ProductLicenseKey": "123-456-789"
              }
          },
          {
              "_index": "logsystem.logs",
              "_type": "_doc",
              "_id": "5e5c1ccbaaa6f1245cc38898",
              "_score": 1.0,
              "_source": {
                  "Action": "Button",
                  "ActionName": "Trackers Multiple Generation",
                  "MachineId": "987-654-321",
                  "Name": "System",
                  "ProductLicenseKey": "123-456-789"
              }
          },
          {
              "_index": "logsystem.logs",
              "_type": "_doc",
              "_id": "5e5c1cd3aaa6f1245cc38899",
              "_score": 1.0,
              "_source": {
                  "Action": "Button",
                  "ActionName": "Fixed Multiple Generation",
                  "MachineId": "987-654-321",
                  "Name": "System",
                  "ProductLicenseKey": "123-456-789"
              }
          },
          {
              "_index": "logsystem.logs",
              "_type": "_doc",
              "_id": "5e5c1ce0aaa6f1245cc3889a",
              "_score": 1.0,
              "_source": {
                  "Action": "Button",
                  "ActionName": "Tree Generation",
                  "MachineId": "987-654-321",
                  "Name": "System",
                  "ProductLicenseKey": "123-456-789"
              }
          }
      ]
   }
  }
  </code></pre>