<p dir="auto">Hi,</p>
<p dir="auto">When I run an identical query on 0.90.1 and 0.90.2 I get different results:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;filter&quot;: {
    &quot;terms&quot;: {
      &quot;field&quot;: {
        &quot;id&quot;: &quot;bar&quot;,
        &quot;type&quot;: &quot;doctype&quot;,
        &quot;path&quot;: &quot;lookupField&quot;
      }
    }
  },
  &quot;query&quot;: {
    &quot;match_all&quot;: {}
  }
}"><pre class="notranslate">{
  <span class="pl-ent">"filter"</span>: {
    <span class="pl-ent">"terms"</span>: {
      <span class="pl-ent">"field"</span>: {
        <span class="pl-ent">"id"</span>: <span class="pl-s"><span class="pl-pds">"</span>bar<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"type"</span>: <span class="pl-s"><span class="pl-pds">"</span>doctype<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"path"</span>: <span class="pl-s"><span class="pl-pds">"</span>lookupField<span class="pl-pds">"</span></span>
      }
    }
  },
  <span class="pl-ent">"query"</span>: {
    <span class="pl-ent">"match_all"</span>: {}
  }
}</pre></div>
<p dir="auto">In 0.90.1 when filter returned no results the result of the query was also empty, i.e. 0 hits.<br>
In 0.90.2 it returns everything. <del>The latter behavior is probably better and more expected</del>, but I haven't seen it documented anywhere. Did I miss something?</p>
<p dir="auto">Given the following script: <a href="https://gist.github.com/dakrone/6034875">https://gist.github.com/dakrone/6034875</a></p>
<p dir="auto">I was expecting the same output for both queries (no documents matched), but instead I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="∴ ./missing-filter-bug.zsh
Regular filter for null_value=true, existence=false
{
  &quot;took&quot; : 2,
  &quot;timed_out&quot; : false,
  &quot;_shards&quot; : {
    &quot;total&quot; : 1,
    &quot;successful&quot; : 1,
    &quot;failed&quot; : 0
  },
  &quot;hits&quot; : {
    &quot;total&quot; : 2,
    &quot;max_score&quot; : 1.0,
    &quot;hits&quot; : [ {
      &quot;_index&quot; : &quot;missing-test&quot;,
      &quot;_type&quot; : &quot;doc&quot;,
      &quot;_id&quot; : &quot;1&quot;,
      &quot;_score&quot; : 1.0, &quot;_source&quot; : { &quot;id&quot;: &quot;1&quot; }
    }, {
      &quot;_index&quot; : &quot;missing-test&quot;,
      &quot;_type&quot; : &quot;doc&quot;,
      &quot;_id&quot; : &quot;2&quot;,
      &quot;_score&quot; : 1.0, &quot;_source&quot; : { &quot;id&quot;: &quot;2&quot;, &quot;myfield&quot;: &quot;foo&quot; }
    } ]
  }
}
Filtered query with filter for null_value=true, existence=false
{
  &quot;took&quot; : 1,
  &quot;timed_out&quot; : false,
  &quot;_shards&quot; : {
    &quot;total&quot; : 1,
    &quot;successful&quot; : 1,
    &quot;failed&quot; : 0
  },
  &quot;hits&quot; : {
    &quot;total&quot; : 0,
    &quot;max_score&quot; : null,
    &quot;hits&quot; : [ ]
  }
}"><pre class="notranslate"><code class="notranslate">∴ ./missing-filter-bug.zsh
Regular filter for null_value=true, existence=false
{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 2,
    "max_score" : 1.0,
    "hits" : [ {
      "_index" : "missing-test",
      "_type" : "doc",
      "_id" : "1",
      "_score" : 1.0, "_source" : { "id": "1" }
    }, {
      "_index" : "missing-test",
      "_type" : "doc",
      "_id" : "2",
      "_score" : 1.0, "_source" : { "id": "2", "myfield": "foo" }
    } ]
  }
}
Filtered query with filter for null_value=true, existence=false
{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}
</code></pre></div>