title: How to execute multiple search query in node.js using elastic search and promises?
body: <p>Elastic Search Code :</p>
  
  <pre><code>POST /_msearch
  { "index": "INDEX_NAME_1", "type": "TYPE_NAME_1" }
  { "query": { "match_all": {}}}
  { "index": "INDEX_NAME_2", "type": "TYPE_NAME_2" }
  { "query": { "match_all": {}}}
  </code></pre>
  
  <p>Reference link <a href="http://teknosrc.com/execute-multiple-search-query-elasticsearch/#comment-8578" rel="nofollow noreferrer">http://teknosrc.com/execute-multiple-search-query-elasticsearch/#comment-8578</a> (Refer example 1)</p>
  
  <p>Node js code :</p>
  
  <pre><code>return new Promise(function (resolve, reject) {
          elasticClient.search({
               index: '*:logstash-prod-*',
               type: 'callEnd',
               size: 10000,
               body: {
                   query: {
  
                       range: {
                           "@timestamp": {
                               "gte": startTime,
                               "lte": endTime
                           }
                       }
                   }
               },
           }, function (error, response, status) {
               if (error) {
                      reject(error);
               }
               else {
                       console.log("show the response" + JSON.stringify(response));
                       let elasticResponse=response.hits.hits;
                       resolve(response);
               }
           })
       });
  </code></pre>
  
  <p>Above node js query works for one type:"callEnd". Please help in converting the Elastic code (two types) to node js code.  </p>