title: How to use join at a same type or index in ElasticSearch like solr
body: <p>Now I got a problem as I need to query some data from a type(or index) named 'product', and I have three parameters( $p1, $p2, $p3) which can determine some catagories,then I need get all the product in those catagories.
  I know how it can be done in MySQL like this:</p>
  
  <pre><code>select * 
  from product 
  where catagory in (
      select catagory 
      from product
      where p1 = $p1 and p2=$p2 and p3=$p3
  )
  </code></pre>
  
  <p>And I know I can do this in solr like </p>
  
  <pre><code>{!join from=catagory to=catagory}p1:$p1 AND p2:$p2 AND p3:$p3
  </code></pre>
  
  <p>But I want to know how can I do this in ElasticSearch.     </p>
  
  <p>BTW,sorry for my pool English. I do appreciate for your help.</p>