原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/modules-scripting-painless.html, 原文档版权归 www.elastic.co 所有
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Painless scripting languageedit
Painless is a simple, secure scripting language designed specifically for use with Elasticsearch. It is the default scripting language for Elasticsearch and can safely be used for inline and stored scripts. To get started with Painless, see the Painless Guide. For a detailed description of the Painless syntax and language features, see the Painless Language Specification.
You can use Painless anywhere scripts can be used in Elasticsearch. Painless provides:
- Fast performance: Painless scripts run several times faster than the alternatives.
- Safety: Fine-grained allowlists with method call/field granularity. See the Painless API Reference for a complete list of available classes and methods.
-
Optional typing: Variables and parameters can use explicit types or the
dynamic
def
type. - Syntax: Extends a subset of Java’s syntax to provide additional scripting language features.
- Optimizations: Designed specifically for Elasticsearch scripting.
Ready to start scripting with Painless? See the Painless Guide for the Painless Scripting Language.