# How can i increase text field limit on aggregations?

**URL:** <https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552>\
**Category:** Elasticsearch\
**Created:** [April 1, 2024, 12:13pm UTC](https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552 "2024-04-01T12:13:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![barisbeytur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barisbeytur/32/133160_2.png) [@barisbeytur](https://discuss.elastic.co/u/barisbeytur)\
**Post date:** [April 1, 2024, 12:13pm UTC](https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552/1 "2024-04-01T12:13:12Z")

</div>

Hello,

I have a SearchGroupedErrorByCriteria method for take data on Elasticsearch and view it on a admin panel table.

I'm using Elasticsearch .NET Client. I have a search descriptor:

```auto
var searchDescriptor = new SearchRequestDescriptor<ServiceLogMonitoringFieldModel>(indexName);

```

I add a query like this to my search descriptor and it has some aggregations:

```auto
  searchDescriptor
                .Size(0)
                .Query(q => q
                .Bool(b => b
                 .Filter(queryDescriptorsFilter.Any() ? queryDescriptorsFilter.ToArray() : null)
                 .Must(queryDescriptorsMust.Any() ? queryDescriptorsMust.ToArray() : null)
                 .MustNot(queryDescriptorsMustNot.Any() ? queryDescriptorsMustNot.ToArray() : null)
                 ))
                .Sort(sortOptionsDescriptor.Any() ? sortOptionsDescriptor.ToArray() : null)
                .Aggregations(a => a
                    .Terms("group_IcCode", avg => avg
                    .Size(10000)
                        .Field(p => p.IcCode)
                        .Aggregations(aa => aa
                           .Terms("group_BmvProductNo", t2 => t2
                               .Size(10000)
                               .Field(f => f.BmvProductNo)
                               .Aggregations(aaa => aaa
                                   .Terms("group_ErrorMessage", t3 => t3
                                   .Field(f => f.ErrMessage.Suffix("keyword"))
                                   .Size(10000)
                                   .Aggregations(aaaa => aaaa
                                           .Max("max_log_date", m => m
                                               .Field(f => f.LogDateUtc)
                                           )
                                       )
                                   )
                               )
                           )
                        )
                    )
                );

```

When I made a request with this query, I realized that I could not see some values in the date range. 5-6 pieces of data were missing, and the data that was missing was data whose text field named ErrMessage was larger than 256 characters. I don't encounter the same problem without using aggregation. Could you please help about this?

Thanks.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 1, 2024, 12:25pm UTC](https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552/2 "2024-04-01T12:25:53Z")

</div>

Welcome!

Check the mapping. I think you are using the default one.

---

<div class="post-metadata">

**Author:** ![barisbeytur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barisbeytur/32/133160_2.png) [@barisbeytur](https://discuss.elastic.co/u/barisbeytur)\
**Post date:** [April 1, 2024, 12:29pm UTC](https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552/3 "2024-04-01T12:29:25Z")

</div>

Hello again,

Thanks for your quick response. I changed the default value by making a request via devtools. This is what the mappings look like now. But still nothing changed.

 ![resim](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d57311301ef779ab9e0c0ff2c62c585cb2bfbb76.png)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 1, 2024, 12:49pm UTC](https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552/4 "2024-04-01T12:49:17Z")

</div>

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with `</>` icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

Did you reindex your data?

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can **copy and paste in Kibana dev console** , click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

Have a look at the [Elastic Stack and Solutions Help · Forums and Slack | Elastic](https://elastic.co/community/help) page. It contains also lot of useful information on how to ask for help.

---

<div class="post-metadata">

**Author:** ![barisbeytur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barisbeytur/32/133160_2.png) [@barisbeytur](https://discuss.elastic.co/u/barisbeytur)\
**Post date:** [April 1, 2024, 1:19pm UTC](https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552/5 "2024-04-01T13:19:45Z")

</div>

I didn't reindex my data after change the ignore\_above field.

There is a code about we wrote for change the ignore\_above value.

```auto
PUT /service_logs_*/_mapping
{
  "properties": {
    "ErrMessage": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 2048
        }
      }
    }
  }
}

```

We used this for change the limit for ignore\_above field from settings.

```auto
PUT service_logs_*/_settings
{
  "index.mapping.field_name_length.limit": 2048
} 

```

This is the mapping request:

```auto
GET service_logs_20220308

```

This is the mapping response:

```auto
{
  "service_logs_20220308": {
    "aliases": {},
    "mappings": {
      "properties": {
        "BmvProductNo": {
          "type": "long"
        },
        "ClientIp": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "ErrMessage": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 2048
            }
          }
        },

(result goes on...)

```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 1, 2024, 2:14pm UTC](https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552/6 "2024-04-01T14:14:17Z")

</div>

That change will only apply to documents indexed from this point on and does not change any documents already indexed. To make this apply to all documents in the index you need to update/reindex.

---

<div class="post-metadata">

**Author:** ![barisbeytur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barisbeytur/32/133160_2.png) [@barisbeytur](https://discuss.elastic.co/u/barisbeytur)\
**Post date:** [April 2, 2024, 3:13pm UTC](https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552/7 "2024-04-02T15:13:21Z")

</div>

Thanks for your help. 🙏

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 30, 2024, 3:13pm UTC](https://discuss.elastic.co/t/how-can-i-increase-text-field-limit-on-aggregations/356552/8 "2024-04-30T15:13:44Z")

</div>

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