Skip to content

Term Filter with empty value compiles to nothing #2086

@SLavrynenko

Description

@SLavrynenko

NEST/Elasticsearch.Net version:
2.0.5

Elasticsearch version:
"version" : {
"number" : "2.1.1",
"build_hash" : "40e2c53a6b6c2972b3d13846e450e66f4375bd71",
"build_timestamp" : "2015-12-15T13:05:55Z",
"build_snapshot" : false,
"lucene_version" : "5.3.1"
},

Description of the problem including expected versus actual behavior:
I've the following code for filter:
filter &= !f.Verbatim().Term(p => p.MobileNumber, "") && f.Exists(m => m.Field(p => p.MobileNumber));

but in the result search query I see just:
{"exists":{"field":"MobileNumber"}}
without expected part with:
{"bool":{"must_not":[{"term":{"MobileNumber":{"value":''}}}]}}

Is the way I'm using Verbatim() correct? Don't understand why it doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions