-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Elasticsearch version: 5.2.2
OS version: Win 10
Description of the problem including expected versus actual behavior:
include
section in the aggregation is unable to create a simple string inside of terms
.
I want to create
"catpaths": {
"terms": {
"field": "categories.categoryPath",
"include": "(/[^/]+){2}"
},
Using Nest statements include
value gets wrapped in []
and pattern
elements:
-
TermsAggregationDescriptor<T> Include(string includePattern, string regexFlags = null);
Nest:
.Include(@"(/[^/]+){2}*","")
DSL:
"include":{"pattern":"(/[^/]+){2}"}} -
TermsAggregationDescriptor<T> Include(IEnumerable<string> values)
Nest:
var sequence = Enumerable.Repeat("(/[^/]+){2}", 1);
.Include(sequence)
DSL:
"include": ["(/[^/]+){2}"]
I need a Nest TermsAggregationDescriptor include
statement that will generate string DSL:
"include": "(/[^/]+){2}"
Extra pattern
element prevents parser to continue with evaluating nested aggs.
Array of include []
uses literal strings and does not evaluate elements regex expression.