Skip to content

Commit 5bde0d4

Browse files
author
k-yomo
committed
Fix elasticstack_elasticsearch_script docs
1 parent 50b83bd commit 5bde0d4

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

docs/resources/elasticsearch_script.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,27 @@ provider "elasticstack" {
1919
2020
resource "elasticstack_elasticsearch_script" "my_script" {
2121
script_id = "my_script"
22+
lang = "painless"
2223
source = "Math.log(_score * 2) + params['my_modifier']"
2324
context = "score"
2425
}
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+
}
2543
```
2644

2745
<!-- schema generated by tfplugindocs -->

examples/resources/elasticstack_elasticsearch_script/resource.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ provider "elasticstack" {
44

55
resource "elasticstack_elasticsearch_script" "my_script" {
66
script_id = "my_script"
7+
lang = "painless"
78
source = "Math.log(_score * 2) + params['my_modifier']"
89
context = "score"
910
}
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+
}

0 commit comments

Comments
 (0)