title: Elastic Search: filter query results by entry its field into another query results
body: <p>I found the question about the IN equivalent operator:</p>
  
  <p><a href="https://stackoverflow.com/questions/30111258/elasticsearch-in-equivalent-operator-in-elasticsearch">ElasticSearch : IN equivalent operator in ElasticSearch</a></p>
  
  <p>But I would to find equivalent to the another more complicated request:</p>
  
  <pre><code> SELECT * FROM table WHERE id IN (SELECT id FROM anotherTable WHERE something &gt; 0);
  </code></pre>
  
  <p>Mapping:</p>
  
  <p>First index:</p>
  
  <pre><code>{
    "mappings": {
      "products": { 
        "properties": { 
          "id":      { "type": "integer" },  
          "name":    { "type": "text"  }, 
        }
      }
    }
  }
  </code></pre>
  
  <p>Second index:</p>
  
  <pre><code>{
    "mappings": {
      "reserved": { 
        "properties": { 
          "id":      { "type": "integer" },  
          "type":    { "type": "text"  }, 
        }
      }
    }
  }
  </code></pre>
  
  <p>I want to get products which ids are contained in reserved index and have the specific type of a reserve.</p>