title: ElasticSearch multiple queries in one
body: <p>I am using ElasticSearch and I want to make a query.</p>
  
  <p>I have differents modules: <code>['a', 'b', 'c', 'd']</code>.
  where <code>a</code> and  <code>b</code> have an extra value (<code>companyId</code>) I need to filter the text of all modules, but I need to filter the <code>companyId</code> just for <code>a</code> and <code>b</code> not for modules <code>c</code> and <code>d</code>.</p>
  
  <p>This will look something like this:</p>
  
  <p><code>SELECT * FROM my_table WHERE (modules in ('a', 'b') and companyId='myid') OR (modules in ('b', 'c'))</code></p>
  
  <p>But I have this:</p>
  
  <pre><code>client.search({
        index: INDEX,
        type: TYPE,
        body: {
          query: {
            bool: {
              must: {
                match: { text: 'mytext' },
              },
              filter: [
                { terms: { module: ['a', 'b', 'c', 'd'] } },
                { term: { companyId: 'myid' } },
              ]
            }
          }
        }
      });
  </code></pre>
  
  <p>Thanks a lot if you can help.</p>