-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path40_render_query.yml
82 lines (76 loc) · 1.71 KB
/
40_render_query.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
requires:
stack: true
serverless: false
---
setup:
- do:
indices.create:
index: test-search-index1
body:
settings:
index:
number_of_shards: 1
number_of_replicas: 0
- do:
indices.create:
index: test-search-index2
body:
settings:
index:
number_of_shards: 1
number_of_replicas: 0
- do:
search_application.put:
name: test-search-application
body:
indices: [ "test-search-index1", "test-search-index2" ]
analytics_collection_name: "test-analytics"
template:
script:
source:
query:
term:
"{{field_name}}": "{{field_value}}"
params:
field_name: field1
field_value: value1
- do:
index:
index: test-search-index1
id: doc1
body:
field1: value1
field2: value1
refresh: true
- do:
index:
index: test-search-index2
id: doc2
body:
field1: value1
field3: value3
refresh: true
---
teardown:
- do:
search_application.delete:
name: test-search-application
ignore: 404
- do:
indices.delete:
index: test-search-index1
ignore: 404
- do:
indices.delete:
index: test-search-index2
ignore: 404
---
'search_application.render_query':
- do:
search_application.render_query:
name: test-search-application
body:
params:
field_name: field2
- match: { query: { term: { field2: {value: "value1"} } } }