# Nest TermsQuery.IsVerbatim empty array not serializing

**URL:** <https://discuss.elastic.co/t/nest-termsquery-isverbatim-empty-array-not-serializing/77630>\
**Category:** Elasticsearch\
**Created:** [March 7, 2017, 10:00am UTC](https://discuss.elastic.co/t/nest-termsquery-isverbatim-empty-array-not-serializing/77630 "2017-03-07T10:00:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![murfee25](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@murfee25](https://discuss.elastic.co/u/murfee25)\
**Post date:** [March 7, 2017, 10:00am UTC](https://discuss.elastic.co/t/nest-termsquery-isverbatim-empty-array-not-serializing/77630/1 "2017-03-07T10:00:10Z")

</div>

Hi,

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": [] }**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 4, 2017, 10:00am UTC](https://discuss.elastic.co/t/nest-termsquery-isverbatim-empty-array-not-serializing/77630/2 "2017-04-04T10:00:12Z")

</div>

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