title: Elasticsearch cross-index query with aggregations
body: <p>I use: Elasticsearch 7.7 , Kibana 7.7</p>
  <p>For example, lets take two indexes:</p>
  <p>User index with simple mapping:</p>
  <pre><code>PUT /user_index
  {
    &quot;mappings&quot;: {
      &quot;properties&quot;: {
        &quot;user_id&quot;:    { &quot;type&quot;: &quot;text&quot; },
        &quot;user_phone&quot;:    { &quot;type&quot;: &quot;text&quot; },
        &quot;name&quot;:   { &quot;type&quot;: &quot;text&quot;  }     
      }
    }
  }
  </code></pre>
  <p>Check with simple mapping:</p>
  <pre><code>PUT /check_index
  {
    &quot;mappings&quot;: {
      &quot;properties&quot;: {
        &quot;user_id&quot;:    { &quot;type&quot;: &quot;text&quot; },  
        &quot;price&quot;:   { &quot;type&quot;: &quot;integer&quot;  },
        &quot;goods_count&quot;:  {&quot;type&quot;: &quot;integer&quot;}
      }
    }
  }
  </code></pre>
  <p>I want to build table visualization like that:</p>
  <pre><code>________________________________________________________________________
    user_id  |   user_phone  | average_price       |    sum_goods_count  |
  ___________|_______________|_____________________|______________________
       1     |       123     |       512           |         64          |
  ___________|_______________|_____________________|______________________
       2     |       456     |       256           |         16          | 
  ___________|_______________|_____________________|______________________
  
  </code></pre>
  <p>So my questions are:</p>
  <ol>
  <li><p>Is it real?</p>
  </li>
  <li><p>Do I understand correctly that I need to query these two indexes, get a list of users, and then in a loop create shopping carts with checks?</p>
  </li>
  </ol>