# Illegal\_argument\_exception

**URL:** <https://discuss.elastic.co/t/illegal-argument-exception/371065>\
**Category:** Elasticsearch\
**Created:** [November 26, 2024, 6:52am UTC](https://discuss.elastic.co/t/illegal-argument-exception/371065 "2024-11-26T06:52:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubham21101997](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@shubham21101997](https://discuss.elastic.co/u/shubham21101997)\
**Post date:** [November 26, 2024, 6:52am UTC](https://discuss.elastic.co/t/illegal-argument-exception/371065/1 "2024-11-26T06:52:09Z")

</div>

**I am getting these error messaage , how to reslove it and also want to know if if i can skip for those document which exceeds the limit**

```auto
{
  "took": 382,
  "timed_out": false,
  "_shards": {
    "total": 16,
    "successful": 15,
    "skipped": 15,
    "failed": 1,
    "failures": [
      {
        "shard": 0,
        "index": ".ds-logs-mulesoft-v2-2024.11.22-000050",
        "node": "8tiEom5CSBixKIDJjGdLDA",
        "reason": {
          "type": "illegal_argument_exception",
          "reason": "The length [1081921] of field [event.original] in doc[238]/index[.ds-logs-mulesoft-v2-2024.11.22-000050] exceeds the [index.highlight.max_analyzed_offset] limit [1000000]. To avoid this error, set the query parameter [max_analyzed_offset] to a value less than index setting [1000000] and this will tolerate long field values by truncating them."
        }
      }
    ]
  },
  "hits": {
    "max_score": null,
    "hits": []
  }
}

```

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [November 26, 2024, 12:07pm UTC](https://discuss.elastic.co/t/illegal-argument-exception/371065/2 "2024-11-26T12:07:54Z")

</div>

Hi @shubham21101997

In the log it says that you must change the value of the [max\_analyzed\_offset](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-max-analyzed-offset) config.  
See the warning: [Highlighting | Elasticsearch Guide [8.16] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/highlighting.html#offsets-strategy)
