title: ES query over different types and join over a common field
body: <p>I'm trying to investigate if this is a possiblity in elasticsearch, since I want to decouple at its best the data, I would like to have inside an <code>index</code> different <code>types</code> one for each field. </p>
  
  <p><strong>Question1</strong>: how bad is this decision?</p>
  
  <p>Now, if I've type <code>name</code>:</p>
  
  <pre><code>/myindex/name
  
  {
      "name" : "mat",
      "id":1
  }
  </code></pre>
  
  <p>and <code>surname</code></p>
  
  <pre><code>/myindex/surname    
  {
      "surname" : "txt",
      "id":1
  }
  </code></pre>
  
  <p><strong>question 2</strong>: how can i create a search that is <code>name='mat AND surname='txt'</code> and returns <code>id</code>?</p>
  
  <p>If I run the query as this (on the index, without specifying the type):</p>
  
  <pre><code>/myindex/_search
  {
  
      "query" : {
         "bool" : {
          "should" : [{
              "term" : { "name" : "mat" }
          },
          {
              "term" : { "surname" : "txt" }
          }]
         }
      }
  }
  </code></pre>
  
  <p>it returns (obviusly) two documents, can I say something like <code>join by id</code> ?</p>