Skip to content

SignificantTerms: Exclude should take List as parameter #2676

@jhellemann

Description

@jhellemann

NEST/Elasticsearch.Net version: v5.2.0

Elasticsearch version: v5.2.2

Description of the problem including expected versus actual behavior:
The SignificantTerms aggregation should be able to take a List<string> in the exclude/include parameters to produce:

"significant_terms": {
        "field": "activityNames.keyword",
        "exclude": 
           [
              "Cardio Pulse",
              "Strength & Core",
              "Power",
              "Dance Step",
              "Hatha Yoga"
            ]        
      }

Now the exclude/include parameters only accepts FluentDictionary<string,string> which produces:

"significant_terms": {
        "field": "activityNames.keyword",
        "exclude": {
          "Cardio Pulse": "Cardio Pulse",
          "Strength & Core": "Strength & Core",
          "Power": "Power",
          "Dance Step": "Dance Step",
          "Hatha Yoga": "Hatha Yoga"
        }
      }

This throws:

    {
        "type": "parsing_exception",
        "reason": "[significant_terms] failed to parse field [exclude]",
        "line": 10,
        "col": 27
      }

Having FluentDictionary<string,string> makes sens in include parameter for the Terms aggregation when running the partition feature:
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_filtering_values_with_partitions

Steps to reproduce:

  1. Run query with SignificantTerms aggregation with a dictionary in exclude parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions