The response contains the average of two script parameters:
```json
{
"result" : "90"
}
```
### Response fields
| Field | Description |
:--- | :---
| result | The script result.|
## Script contexts
Choose different contexts to control the variables that are available to the script and the result's return type. The default context is `painless_test`.
### Painless test context
The `painless_test` context is the default script context that provides only the `params` variable to the script. The returned result is always converted to a string. See the preceding sample request for a usage example.
### Filter context
The `filter` context runs the script as if the script were inside a script query. You must provide a test document in the context. The `_source`, stored fields, and `_doc` variables will be available to the script.
You can specify the following parameters for the filter context in the `context_setup`.
Parameter | Description
:--- | :---
document | The document that is indexed in memory temporarily and available to the script.
index | The name of the index that contains a mapping for the document.
For example, first create an index with a mapping for a test document: