Significant Terms - Exclude list of specific terms

I'm using Significant Terms to find high frequency keywords in a text field. I'm using regex in the Include parameter, but want to Exclude certain exact terms I don't care about:

//"include": "([a-zA-Z]{2,10}_)+[a-zA-Z]{2,10}",
//"exclude" : ["not_this","not_that"]

I based this exclude statement on the model in the Terms Aggregation document, but I get an error when trying to apply it to my visualization

//[significant_terms] failed to parse field [exclude]

The IncludeExclude class that implements this has the limitation that an include list which is a regex can only be filtered by an exclude class which is also a regex. That means you'd need to rewrite as:

"include": "([a-zA-Z]{2,10}_)+[a-zA-Z]{2,10}",
"exclude" : "not_this|not_that"

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