Home > Back-end >  Is there a limit to Elasticsearch Aggregation Names Length?
Is there a limit to Elasticsearch Aggregation Names Length?

Time:12-13

I'm reading through the Elasticsearch documentation and haven't been able to find an answer to this question.

Is there a limit on the maxmium length of a name that can be given to an aggregation step?

Just to be clear, when I say aggregation step name, I am referring to my-agg-name in the following example from the Elastic search docs:

GET /my-index-000001/_search
{
  "size": 0,
  "aggs": {
    "my-agg-name": {
      "terms": {
        "field": "my-field"
      }
    }
  }
}

I know this is a bit of a ridiculous question but I am working on a system that is programmatically building complex aggregations with part of its input coming from user entry - the use case is a bit complicated, so I need to know what limitations I need to impose on the user.

CodePudding user response:

I tried with 126500 characters as aggregation name. Inside this example,and I don’t know which user want to write such a long text in an input :). I could not see a limitation of the names in aggregation. As mentioned by @sinanorl there can be a limitation for Java string variable length. But I want to mention that the other problem here is request sizes. When you put there such a long name, the request size increases. This means that to process the request, machines start using more resources to handle this long-named request, and pretty sure that this makes slowness. So I think you need to force the user with a logical size.

  • Related