title: Elasticsearch document structure for performance optimization
body: <p>In Elasticsearch is it better to query on 50 fields in 1,000,000 documents or 1 field in 50,000,000 documents. I'll explain my problem with an example:</p>
  
  <p>For case 1, our doc looks like:</p>
  
  <pre><code>doc1: {
      "f1": "abc",
      "f2": "pqr",
      "f3": "lmn",
      ...
      "f50": "xyz"
  }
  </code></pre>
  
  <p>Here a should query will be performed from "f1" to "f50".</p>
  
  <p>For case 2, our doc will look like:</p>
  
  <pre><code>doc1.1: {
      "f": "abc"
  }
  
  doc1.2: {
      "f": "pqr"
  }    
  
  doc1.3: {
      "f": "lmn"
  }
  ...
  ...
  doc1.50: {
      "f": "xyz"
  }
  </code></pre>
  
  <p>Let's just say I am concerned about the docs containing the queried value irrespective of the field.</p>