Skip to content

Aggregation key can't be number #56402

Closed
@rightaway

Description

@rightaway

Elasticsearch version (bin/elasticsearch --version): 7.6.2

Plugins installed: []

JVM version (java -version): 13.0.2

OS version (uname -a if on a Unix-like system): archlinux

Description of the problem including expected versus actual behavior:

If you use a numeric key for a range aggregation you get an error. But string key works fine. Numeric keys should be accepted and turned into strings instead of failing.

Steps to reproduce:

aggs: {
  agg1: {
    range: {
      field: "agg1",
      ranges: [{ key: 1, from 1 }]
    }
  }
}

Provide logs (if relevant):

      type: 'x_content_parse_exception',
      reason: '[1:641] [range] failed to parse field [ranges]',
      caused_by: {                                                  
        type: 'parsing_exception',                                  
        reason: 'Failed to parse object: unknown field [key] found',
        line: 1,                                                    
        col: 641                                                    
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions