-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path10_basic.yml
43 lines (43 loc) · 902 Bytes
/
10_basic.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
requires:
serverless: true
stack: true
---
setup:
- do:
indices.create: { index: 'script_test' }
- do:
index:
index: 'script_test'
body: { name: 'test' }
refresh: true
---
teardown:
- do:
indices.delete: { index: 'script_test' }
---
'scripts':
- do:
put_script:
id: 'my_script'
body:
script:
lang: 'painless'
source: "Math.log(_score * 2)"
- match: { acknowledged: true }
- do:
get_script: { id: 'my_script' }
- match: { _id: 'my_script' }
- match: { found: true }
- do:
delete_script: { id: 'my_script' }
- match: { acknowledged: true }
- do:
scripts_painless_execute:
body:
script:
source: "params.count / params.total"
params:
count: 100.0
total: 1000.0
- match: { result: '0.1' }