File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
examples/resources/elasticstack_elasticsearch_script Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,27 @@ provider "elasticstack" {
19
19
20
20
resource "elasticstack_elasticsearch_script" "my_script" {
21
21
script_id = "my_script"
22
+ lang = "painless"
22
23
source = "Math.log(_score * 2) + params['my_modifier']"
23
24
context = "score"
24
25
}
26
+
27
+ resource "elasticstack_elasticsearch_script" "my_search_template" {
28
+ script_id = "my_search_template"
29
+ lang = "mustache"
30
+ source = jsonencode({
31
+ query = {
32
+ match = {
33
+ message = "{{query_string}}"
34
+ }
35
+ }
36
+ from = "{{from}}"
37
+ size = "{{size}}"
38
+ })
39
+ params = jsonencode({
40
+ query_string = "My query string"
41
+ })
42
+ }
25
43
```
26
44
27
45
<!-- schema generated by tfplugindocs -->
Original file line number Diff line number Diff line change @@ -4,6 +4,24 @@ provider "elasticstack" {
4
4
5
5
resource "elasticstack_elasticsearch_script" "my_script" {
6
6
script_id = " my_script"
7
+ lang = " painless"
7
8
source = " Math.log(_score * 2) + params['my_modifier']"
8
9
context = " score"
9
10
}
11
+
12
+ resource "elasticstack_elasticsearch_script" "my_search_template" {
13
+ script_id = " my_search_template"
14
+ lang = " mustache"
15
+ source = jsonencode ({
16
+ query = {
17
+ match = {
18
+ message = " {{query_string}}"
19
+ }
20
+ }
21
+ from = " {{from}}"
22
+ size = " {{size}}"
23
+ })
24
+ params = jsonencode ({
25
+ query_string = " My query string"
26
+ })
27
+ }
You can’t perform that action at this time.
0 commit comments