title: Filtering empty or non empty array in Elasticsearch Kibana
body: <p>How can I search for an empty array or non empty array field in Kibana? To be more precise: There is an api that is used for queries and these requests/responses are logged. The search may result in an empty array if no elements have been found: 'response: []'. In other cases this &quot;Response&quot; field is an array populated with objects: 'response: [{&quot;myProp&quot;: &quot;something&quot;}, {&quot;myProp&quot;: &quot;something2&quot;}]'.<br/>
  I've tried to use DSL queries, nested searches and other Stackoverflow answers but without success.
  For the following I get syntax error (or for any other solution I try to use) in the Kibana DSL query:</p>
  <pre><code>&quot;must_not&quot;: {
    &quot;script&quot;: {
      &quot;script&quot;: &quot;response.size() &gt; 0&quot;
    }
  }
  </code></pre>
  <p>or using the following results in an Internal Server Error:</p>
  <pre><code>{
    &quot;script&quot;: &quot;response.size &gt; 0&quot;
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Sigre.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sigre.png" alt="enter image description here" /></a></p>