title: What is the ElasticSearch equivalent for an SQL subquery?
body: <p>Can you nest queries logically in ElasticSearch, so the output of one query is the input to another query.
  Another, way to ask is how can I chain or pipe queries together?</p>
  
  <p>This should be analogous to the IN operator or subqueries in SQL </p>
  
  <p>i.e.:-
  select au_lname, au_fname, title from 
       (select au_lname, au_fname, au_id from pubs.dbo.authors
            where state = 'CA')
  or</p>
  
  <p>SELECT Name
  FROM AdventureWorks2008R2.Production.Product
  WHERE ListPrice =
      (SELECT ListPrice
       FROM AdventureWorks2008R2.Production.Product
       WHERE Name = 'Chainring Bolts' );</p>