Type to search.

ignore_above

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Strings longer than the ignore_above setting will not be indexed or stored. For arrays of strings, ignore_above will be applied for each array element separately and string elements longer than ignore_above will not be indexed or stored.

Note

All strings/array elements will still be present in the _source field, if the latter is enabled which is the default in Elasticsearch.

Note

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Planned We plan to add this functionality in a future Elastic Stack update. Subject to changes. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes. Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability Preview This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. In columnar index modes, ignore_above has no effect, whether or not the field is indexed: _source is rebuilt from doc values, so every value is kept regardless of length. This covers the field parameter, the index.mapping.ignore_above setting, and index-mode defaults. Over-limit values are searchable and are not added to _ignored. Non-indexed keyword and flattened fields accept values of up to index.mapping.non_indexed_field.max_value_length bytes, which is 1mb by default. Fields that are indexed, still fail on values longer than Lucene's 32766-byte term limit. Columnar indices created before 9.6 keep the previous behavior.

JSON
PUT my-index-000001
{
  "mappings": {
    "properties": {
      "message": {
        "type": "keyword",
        "ignore_above": 20
      }
    }
  }
}
PUT my-index-000001/_doc/1
{
  "message": "Syntax error"
}
PUT my-index-000001/_doc/2
{
  "message": "Syntax error with some long stacktrace"
}
GET my-index-000001/_search
{
  "aggs": {
    "messages": {
      "terms": {
        "field": "message"
      }
    }
  }
}
  1. This field will ignore any string longer than 20 characters.
  2. This document is indexed successfully.
  3. This document will be indexed, but without indexing the message field.
  4. Search returns both documents, but only the first is present in the terms aggregation.
Tip

The ignore_above setting can be updated on existing fields using the update mapping API.

Outside columnar index modes, this option is also useful for protecting against Lucene’s term byte-length limit of 32766.

Note

The value for ignore_above is the character count, but Lucene counts bytes. If you use UTF-8 text with many non-ASCII characters, you may want to set the limit to 32766 / 4 = 8191 since UTF-8 characters may occupy at most 4 bytes.