NEST Driver is adding extra "pattern" element to "include"


I'm having an issue with using Include element from DSL in Nest syntax.

When Nest request is serialized it adds extra "pattern" element in DSL which prevents aggs below from being evaluated:

Nest Syntax:

Func<AggregationContainerDescriptor, IAggregationContainer> catPathagg = oo => oo.Terms("catpaths", term => term

DSL generated:

"aggs": { "catpaths": {
   "terms": {
   "field": "categories.categoryPath",
   "include": {
   "pattern": "(/[^/]+){2}"

Additional "pattern" element stops parser with continuing with next aggregation.

The DSL that I'm expecting and is working for me is the following:

"aggs": {
"catpaths": {
"terms": {
"field": "categories.categoryPath",
"include": "(/[^/]+){2}"

Extra "pattern" element is really problematic in nested aggregation. It only works if it's included in the last aggregate element.

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