title: Are there downsides of indexing every field in Elasticsearch index?
body: <p>I found information about how number of shards, number of fields in mapping, affect performance of Elasticsearch. But I could not find any information about how indexing or not indexing a field affect cluster performance. </p>
  
  <p>Imagine I have document like:</p>
  
  <pre><code>{
    "name":"John Doe", 
    "photoPath":"/var/www/public/images/i1/j/d/123456.jpg", 
    "passwordHash":"$12$3b$abc...354", 
    "bio":"..."
  }
  </code></pre>
  
  <p>I need to put 10 to 100 such documents to the cluster each second. When I put such document in index I am pretty sure I'd need to fulltext search for name and fulltext search for bio. I will never search for photoPath and I will never need fulltext search for password hash. </p>
  
  <p>When I do my mapping I have several options:</p>
  
  <ul>
  <li>make all fields text and analyze them with simple analyzer (i.e. tokenize by any not-character) - in that case I will have terms like "i1", "3b" or "123456" in my index</li>
  <li>make name and bio text, make password hash keyword and make photoPath non-indexed</li>
  </ul>
  
  <hr>
  
  <p>So my questions are:</p>
  
  <ul>
  <li>In what ways, if any, am I improving performance in case I use the second option with custom tailored field types? </li>
  <li>Am I correct in my assumption that having less fields indexed helps performance? </li>
  <li>Am I correct in my assumption that indexing fewer fields will improve indexing performance? </li>
  <li>Am I correct in my assumption that actual search will be faster if I index only what I need? </li>
  </ul>