title: Elastic search Multiple Aggregation
body: <p>I have two elastic search queries </p>
  
  <ol>
  <li>For Get transaction information for a particular day</li>
  <li>For get transaction information for all days </li>
  </ol>
  
  <p>How can i combine these two quires into a single query? Am struggling to write a signle query for these two similar needs. Please help me to solve this issue. Thank you </p>
  
  <pre><code>{
    "query": {
      "filtered": {
        "query": {
          "match": {
            "payment_type": "paypal"
          }
        },
        "filter": {
          "range": {
            "transaction_date": {
              "from": "2014-11-10",
              "to": "2014-11-10"
            }
          }
        }
      }
    },
    "aggs": {
      "daily_price_sum": {
        "sum": {
          "field": "price"
        }
      },
      "daily_post_sum": {
        "sum": {
          "field": "purchased_post_count"
        }
      }
    }
  }
  
  
  {
    "size": 0, 
    "query": {
      "match": {
        "payment_type": "paypal"
      }
    },
    "aggs": {
      "daily_price_sum": {
        "sum": {
          "field": "price"
        }
      },
      "daily_post_sum": {
        "sum": {
          "field": "purchased_post_count"
        }
      }
    }
  }
  </code></pre>