clojurewerkz

ronaldsuwandi 2015-10-09T09:59:44.000004Z

hi all, I’m having missing filter issue with elastisch. I have the following records

{:name "a" :email "<mailto:a@a.com|a@a.com>"}
{:name "b" :email nil}
{:name "c" :email nil}
and querying it directly from elastic search works fine GET /uni_test/users/_search returns all 3 records while
GET /uni_test/users/_search
{
    "query": {
        "filtered": {
            "query": {
                "match_all": {}
            },
            "filter":{
                "missing": {
                    "field": "email"
                }
            }
        }        
    }
}
returns 2 records as expected, but when I do it in elastisch I keep getting all 3 records
(doc/search *es* test-index (name :users)
                          {:query {:filtered {:filter {:missing {:field :email}}
                                              :query {:match_all {}}}}})
am I missing something? I’ve tried with both :filter and :query as well as :filtered query, also tried using elastisch 2.1.0, 2.2.0-beta4 and even upgraded elasticsearch client to 1.7.2…