mirror of
https://github.com/iSharkFly-Docs/opensearch-docs-cn
synced 2025-03-09 14:38:01 +00:00
* Make API reference top level Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix typo on Drag and Drop page (#1633) * Fix typo on Drag and Drop page * Update _dashboards/drag-drop-wizard.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update drag-drop-wizard.md Co-authored-by: Nate Bower <nbower@amazon.com> * Putting all the Docker install material on a single page (#1452) * Putting all the Docker install material on a single page Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Making room for revamp Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Intro added Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing to flesh out the intro section and overview Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Overview finalized Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Introducing docker compose Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Added link to compose Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing docker image commentary Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Sometimes I wonder if anyone reads these Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding notes on installing compose with pip Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding prereqs Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Magnets - how do they work? Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Almonds and peaches are part of the same plant subgenus, Amygdalus Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * There are 293 ways to make change for a dollar Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * A shark is the only known fish that can blink with both eyes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * A crocodile cannot stick its tongue out Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * wording Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Reorganizing a couple paragraphs to make it flow better Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Forgot a word Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Add tip about pruning stopped containers Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Cleaning up Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Add blurb about container ls Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding the Docker Compose stuff Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Working on compose Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing work on the compose section - it's a lot of info Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Added important settings Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Updates to settings that need configured Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Still working through compose things Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixed wording Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Working through compose commands and guidance Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Reordering/rewording Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * More phrasing Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * More wording in steps Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * More wording in steps Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Organizing Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding stuff and things Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing to work through the configuration steps Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Still working on the configuration steps Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Changes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * More work Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Removed perf analyzer - refer to GH issue 1555 Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixing things Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding guidance on passing settings in compose Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Working through dockerfile materials now Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * wording Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Finalized the sample dev compose file Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing work with configuration Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Finished - ready for reviews Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixed a link I forgot to change before Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Changes from first proofread Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Changed heading Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Addressed reviewer comments and made some changes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Forgot to incorporate one change. Fixed. Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Final editorial changes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * fix#1584-custom_attr_allowlist (#1636) Signed-off-by: cwillum <cwmmoore@amazon.com> Signed-off-by: cwillum <cwmmoore@amazon.com> * Update TERMS.md with definition for Setting (#1632) * fix#1631-Terms-setting Signed-off-by: cwillum <cwmmoore@amazon.com> * fix#1631-Terms-setting Signed-off-by: cwillum <cwmmoore@amazon.com> Signed-off-by: cwillum <cwmmoore@amazon.com> * Add disclaimer about remote fs usage and an example of setting env var (#1644) * Add disclaimer about remote fs usage and an example of setting env var Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Enhanced wording a little bit Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * [DOC] New documentation: Self-host maps server (#1625) * Add new page self-host maps server Signed-off-by: vagimeli <vagimeli@amazon.com> * Added new content Signed-off-by: vagimeli <vagimeli@amazon.com> * Copy edit Signed-off-by: vagimeli <vagimeli@amazon.com> * Tech review edits Signed-off-by: vagimeli <vagimeli@amazon.com> * Doc review edits Signed-off-by: vagimeli <vagimeli@amazon.com> * Editorial review changes Signed-off-by: vagimeli <vagimeli@amazon.com> * Final edits Signed-off-by: vagimeli <vagimeli@amazon.com> Signed-off-by: vagimeli <vagimeli@amazon.com> * Add feedback. Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix links Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> Signed-off-by: cwillum <cwmmoore@amazon.com> Signed-off-by: vagimeli <vagimeli@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: Jeff Huss <jeffhuss@amazon.com> Co-authored-by: Chris Moore <107723039+cwillum@users.noreply.github.com> Co-authored-by: Melissa Vagi <105296784+vagimeli@users.noreply.github.com>
575 lines
12 KiB
Markdown
575 lines
12 KiB
Markdown
---
|
|
layout: default
|
|
title: Get Stored Script Contexts
|
|
parent: Script APIs
|
|
nav_order: 5
|
|
---
|
|
|
|
## Get stored script contexts
|
|
|
|
Retrieves all contexts for stored scripts.
|
|
|
|
#### Sample request
|
|
|
|
````json
|
|
GET _script_context
|
|
````
|
|
|
|
#### Sample response
|
|
|
|
The `GET _script_context` request returns the following fields:
|
|
|
|
````json
|
|
{
|
|
"contexts" : [
|
|
{
|
|
"name" : "aggregation_selector",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "boolean",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "aggs",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "java.lang.Object",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getDoc",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "get_score",
|
|
"return_type" : "java.lang.Number",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "get_value",
|
|
"return_type" : "java.lang.Object",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "aggs_combine",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "java.lang.Object",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getState",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "aggs_init",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "void",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getState",
|
|
"return_type" : "java.lang.Object",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "aggs_map",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "void",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getDoc",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getState",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "get_score",
|
|
"return_type" : "double",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "aggs_reduce",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "java.lang.Object",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getStates",
|
|
"return_type" : "java.util.List",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "analysis",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "boolean",
|
|
"params" : [
|
|
{
|
|
"type" : "org.opensearch.analysis.common.AnalysisPredicateScript$Token",
|
|
"name" : "token"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "bucket_aggregation",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "java.lang.Number",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "field",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "java.lang.Object",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getDoc",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "filter",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "boolean",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getDoc",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "ingest",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "void",
|
|
"params" : [
|
|
{
|
|
"type" : "java.util.Map",
|
|
"name" : "ctx"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "interval",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "boolean",
|
|
"params" : [
|
|
{
|
|
"type" : "org.opensearch.index.query.IntervalFilterScript$Interval",
|
|
"name" : "interval"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "moving-function",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "double",
|
|
"params" : [
|
|
{
|
|
"type" : "java.util.Map",
|
|
"name" : "params"
|
|
},
|
|
{
|
|
"type" : "double[]",
|
|
"name" : "values"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "number_sort",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "double",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getDoc",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "get_score",
|
|
"return_type" : "double",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "painless_test",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "java.lang.Object",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "processor_conditional",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "boolean",
|
|
"params" : [
|
|
{
|
|
"type" : "java.util.Map",
|
|
"name" : "ctx"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "score",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "double",
|
|
"params" : [
|
|
{
|
|
"type" : "org.opensearch.script.ScoreScript$ExplanationHolder",
|
|
"name" : "explanation"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "getDoc",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "get_score",
|
|
"return_type" : "double",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "script_heuristic",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "double",
|
|
"params" : [
|
|
{
|
|
"type" : "java.util.Map",
|
|
"name" : "params"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "similarity",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "double",
|
|
"params" : [
|
|
{
|
|
"type" : "double",
|
|
"name" : "weight"
|
|
},
|
|
{
|
|
"type" : "org.opensearch.index.similarity.ScriptedSimilarity$Query",
|
|
"name" : "query"
|
|
},
|
|
{
|
|
"type" : "org.opensearch.index.similarity.ScriptedSimilarity$Field",
|
|
"name" : "field"
|
|
},
|
|
{
|
|
"type" : "org.opensearch.index.similarity.ScriptedSimilarity$Term",
|
|
"name" : "term"
|
|
},
|
|
{
|
|
"type" : "org.opensearch.index.similarity.ScriptedSimilarity$Doc",
|
|
"name" : "doc"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "similarity_weight",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "double",
|
|
"params" : [
|
|
{
|
|
"type" : "org.opensearch.index.similarity.ScriptedSimilarity$Query",
|
|
"name" : "query"
|
|
},
|
|
{
|
|
"type" : "org.opensearch.index.similarity.ScriptedSimilarity$Field",
|
|
"name" : "field"
|
|
},
|
|
{
|
|
"type" : "org.opensearch.index.similarity.ScriptedSimilarity$Term",
|
|
"name" : "term"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "string_sort",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "java.lang.String",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getDoc",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "get_score",
|
|
"return_type" : "double",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "template",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "java.lang.String",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "terms_set",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "java.lang.Number",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getDoc",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "trigger",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "boolean",
|
|
"params" : [
|
|
{
|
|
"type" : "org.opensearch.alerting.script.QueryLevelTriggerExecutionContext",
|
|
"name" : "ctx"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name" : "update",
|
|
"methods" : [
|
|
{
|
|
"name" : "execute",
|
|
"return_type" : "void",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getCtx",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
},
|
|
{
|
|
"name" : "getParams",
|
|
"return_type" : "java.util.Map",
|
|
"params" : [ ]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
````
|
|
|
|
### Response fields
|
|
|
|
The `GET _script_context` request returns the following response fields:
|
|
|
|
| Field | Data Type | Description |
|
|
:--- | :--- | :---
|
|
| contexts | List | A list of all contexts. See [Script object](#script-context). |
|
|
|
|
#### Script context
|
|
|
|
| Field | Data Type | Description |
|
|
:--- | :--- | :---
|
|
| name | String | The context name. |
|
|
| methods | List | List of the context's allowable methods. See [Script object](#context-methods). |
|
|
|
|
#### Context methods
|
|
|
|
| Field | Data Type | Description |
|
|
:--- | :--- | :---
|
|
| name | String | Method name. |
|
|
| name | String | Type that the method returns (`boolean`, `object`, `number`, and so on). |
|
|
| params | List | List of the parameters accepted by the method. See [Script object](#method-parameters). |
|
|
|
|
#### Method parameters
|
|
|
|
| Field | Data Type | Description |
|
|
:--- | :--- | :---
|
|
| type | String | Parameter data type. |
|
|
| name | String | Parameter name. | |