title: Boolean query is not matching exclusive condition in ElasticSearch
body: <p>I have the next problem, my data structure has this shape:<br />
  <code>{&quot;editions&quot;:['optionA', 'optionB']}</code><br />
  I need to <strong>exclude ALL</strong> results with this shape:<br />
  <code>{&quot;editions&quot;:['optionB']}</code></p>
  <p>But <strong>include ALL</strong> results with this shape:</p>
  <p><code>{&quot;editions&quot;:['optionA']}</code></p>
  <p>or</p>
  <p><code>{&quot;editions&quot;:['optionA', 'optionB']}</code></p>
  <p>Being more clear, I need to exclude all results that just have one entry in <em>editions</em> and his value is <code>optionB</code> specifically.</p>
  <p>I've been trying something like:</p>
  <pre><code>bool: {
    must: [
      {
      query_string: {
          default_field: &quot;name&quot;,
          query: `${params.text}*`
        },
      }
    ],
    must_not : {
      term : { &quot;editions&quot; : &quot;optionB&quot; },
      must : {
          script : {
              script : {
                  inline: &quot;doc['editions'].values.length &lt; 2&quot;,
                  lang: &quot;painless&quot;
               }
          }
      }
    }
  }
  </code></pre>
  <p>But no results are given. Thanks in advance!</p>
  <p>PD: I'm using ElasticSearch <strong>7.</strong>*</p>