Nest TermsQuery.IsVerbatim empty array not serializing


I am creating a TermsQuery which sometimes has an empty terms array and using IsVerbatim hoping this will still serialize.
var termsQuery = new TermsQuery()
IsVerbatim = true,
Field = myfieldPath,
Terms = termsArray

The field name is always there but when serialized all I get is an empty "terms" query
"terms": {}

And elastic returns a 400 response:
reason=[terms] query requires a field name, followed by array of terms or a document lookup specification

I'm using NEST v5.0.1

Should it be possible to Serialize a TermsQuery with empty terms using the "IsVerbatim" property ?
"terms": { "myFieldPath": [] }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.