title: How to get all the indexes and filter the indexes by using Nest in C#
body: <p>I need to list all the indexes and types in Elasticsearch.</p>
  
  <p>Basically I use <code>_client.stats().Indices</code> to acquire the indexes, and filter using <code>foreach</code> excluded index list like this:</p>
  
  <pre><code>public Dictionary&lt;string, Stats&gt; AllIndexes()
  {
      _client = new ElasticClient(setting);
      var result = _client.Stats();
      var allIndex = result.Indices;
      var excludedIndexList = ExcludedIndexList();
      foreach (var index in excludedIndexList)
      {
          if (allIndex.ContainsKey(index)) allIndex.Remove(index);
      }
  
      return allIndex;
  }
  </code></pre>
  
  <p>Is this right way to do to list all the indexes from Elasticsearch or is there a better way?</p>