title: How to retrieve all document ids (_id) in a specific index
body: <p>I am trying to retrieve all documents in an index, while getting only the _id field back.</p>
  
  <p>Basically I want to retrieve all the document ids I have.</p>
  
  <p>While using:</p>
  
  <pre><code>{
     "query": {
         "match_all": {}
     },
     "fields": []
  }
  </code></pre>
  
  <p>The hits I get contain: "_index", "_type", "_id" , "_score", "_source" 
  which is way more then I need.</p>
  
  <p><strong>Edit(Answer)</strong>:
  So my problem was that I used KOPF to run the queries, and the results were not accurate (got the _source and some more..)! When using curl I got the correct results!</p>
  
  <p>So the above query actually achieved what I needed!
  You can also use:</p>
  
  <pre><code>{
     "query": {
        "match_all": {}
     },
     "_source": false,
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{
     "query": {
        "match_all": {}
     },
     "fields": ["_id"]
  }
  </code></pre>