Skip to content

Verbatim Terms query with Empty Terms gives invalid search json #2812

@Koenyn

Description

@Koenyn

NEST/Elasticsearch.Net version:
5.4.0

Elasticsearch version:
5.5

Description of the problem including expected versus actual behavior:
Verbatim Terms query with an empty array of terms is producing an invalid search request

SearchDescriptor<Test> searchDescriptor = new SearchDescriptor<Test>() .Index("test") .Type("type") .Size(5) .Query(q => q.Terms(t => t.Verbatim().Field(f => f.Things).Terms(new string[] { })));

results in

{ "size": 5, "query": { "terms": {} } }

I expected
{ "query": { "terms": { "things": [ ] } }, "size": 5 }

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