Null values in AfterKey of Composite Aggregation are ignored in NEST 6.3.0 - 6.5.0

Hi guys,

I'm using Composite Aggregation to summarize data. Since some fields may be missing, I set missing_bucket = true, so the returned after_key may contain key-value pairs with null values, like

"after_key" : {
"field1" : "blah blah",
"field2" : null
}

When > I assigned this to Nest.CompositeAggregation.After and invoked ElasticClient.Search,
I got errors like

"reason": {
"type" : "illegal_argument_exception",
"reason" : "[after] has 1 value(s) but [sources] has 2",
...
}

It turned out the request sent to ES changed and the key-value pair with null value in composite.after was ignored:

"composite": {
"after": {
"field1" : "blah blah"
},
...
}

I guess when I send the Nest.SearchRequest, NEST serializer just ignored null values. What should I do to let NEST internal serializer include null values in the after key of Composite Aggregation?

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