- Painless Scripting Language: other versions:
- Getting Started with Painless
- Painless Language Specification
- Painless contexts
- Context examples
- Ingest processor context
- Update context
- Update by query context
- Reindex context
- Sort context
- Similarity context
- Weight context
- Score context
- Field context
- Filter context
- Minimum should match context
- Metric aggregation initialization context
- Metric aggregation map context
- Metric aggregation combine context
- Metric aggregation reduce context
- Bucket script aggregation context
- Bucket selector aggregation context
- Analysis Predicate Context
- Watcher condition context
- Watcher transform context
- Painless API Reference
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Analysis Predicate Context
editAnalysis Predicate Context
editUse a painless script to determine whether or not the current token in an analysis chain matches a predicate.
Variables
-
params
(Map
, read-only) - User-defined parameters passed in as part of the query.
-
token.term
(CharSequence
, read-only) - The characters of the current token
-
token.position
(int
, read-only) - The position of the current token
-
token.positionIncrement
(int
, read-only) - The position increment of the current token
-
token.positionLength
(int
, read-only) - The position length of the current token
-
token.startOffset
(int
, read-only) - The start offset of the current token
-
token.endOffset
(int
, read-only) - The end offset of the current token
-
token.type
(String
, read-only) - The type of the current token
-
token.keyword
('boolean`, read-only) - Whether or not the current token is marked as a keyword
Return
-
boolean
- Whether or not the current token matches the predicate
API
The standard Painless API is available.
Was this helpful?
Thank you for your feedback.