Skip to content

Commit 46fa6f6

Browse files
committed
Merge branch 'feat/tls-index' into 'master'
feat: 更新 tls index 资源 [skipped] See merge request iaasng/terraform-provider-volcengine!519
2 parents e5912ec + 12e31fe commit 46fa6f6

File tree

7 files changed

+26
-5
lines changed

7 files changed

+26
-5
lines changed

common/common_volcengine_version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ package common
22

33
const (
44
TerraformProviderName = "terraform-provider-volcengine"
5-
TerraformProviderVersion = "0.0.146"
5+
TerraformProviderVersion = "0.0.147"
66
)

example/tlsIndex/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "volcengine_tls_index" "foo" {
2-
topic_id = "7ce12237-6670-44a7-9d79-2e36961586e6"
2+
topic_id = "227a8d0c-b85b-48df-bee1-0927a595****"
33

44
# full_text {
55
# case_sensitive = true
@@ -13,7 +13,8 @@ resource "volcengine_tls_index" "foo" {
1313
case_sensitive = true
1414
delimiter = "!"
1515
include_chinese = false
16-
sql_flag = false
16+
sql_flag = true
17+
index_all = true
1718
json_keys {
1819
key = "class"
1920
value_type = "text"

volcengine/tls/index/data_source_volcengine_tls_indexes.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ func DataSourceVolcengineTlsIndexes() *schema.Resource {
115115
Computed: true,
116116
Description: "Whether the filed is enabled for analysis.",
117117
},
118+
"index_all": {
119+
Type: schema.TypeBool,
120+
Computed: true,
121+
Description: "Whether to create indexes for all fields in JSON fields with text values.",
122+
},
118123
"json_keys": {
119124
Type: schema.TypeList,
120125
Computed: true,

volcengine/tls/index/resource_volcengine_tls_index.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ func ResourceVolcengineTlsIndex() *schema.Resource {
108108
Default: false,
109109
Description: "Whether the filed is enabled for analysis.",
110110
},
111+
"index_all": {
112+
Type: schema.TypeBool,
113+
Optional: true,
114+
Default: false,
115+
Description: "Whether to create indexes for all fields in JSON fields with text values. This field is valid when the `value_type` is `json`.",
116+
},
111117
"json_keys": {
112118
Type: schema.TypeSet,
113119
Optional: true,

volcengine/tls/index/service_volcengine_tls_index.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ func transKeyValueToRequest(keyValueSet interface{}) ([]interface{}, error) {
330330
}
331331
keyValue["Key"] = kMap["key"]
332332
valueMap["ValueType"] = kMap["value_type"]
333+
sqlFlag := false
333334
if v, ok := kMap["case_sensitive"]; ok {
334335
valueMap["CaseSensitive"] = v
335336
}
@@ -339,8 +340,12 @@ func transKeyValueToRequest(keyValueSet interface{}) ([]interface{}, error) {
339340
if v, ok := kMap["delimiter"]; ok {
340341
valueMap["Delimiter"] = v
341342
}
343+
if v, ok := kMap["index_all"]; ok {
344+
valueMap["IndexAll"] = v
345+
}
342346
if v, ok := kMap["sql_flag"]; ok {
343347
valueMap["SqlFlag"] = v
348+
sqlFlag = v.(bool)
344349
}
345350
if v, ok := kMap["json_keys"]; ok {
346351
jsonKeys := make([]interface{}, 0)
@@ -360,6 +365,7 @@ func transKeyValueToRequest(keyValueSet interface{}) ([]interface{}, error) {
360365
if v, ok = keyMap["value_type"]; ok {
361366
jsonValue := make(map[string]interface{})
362367
jsonValue["ValueType"] = v
368+
jsonValue["SqlFlag"] = sqlFlag
363369
jsonKey["Value"] = jsonValue
364370
}
365371
jsonKeys = append(jsonKeys, jsonKey)

website/docs/d/tls_indexes.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ In addition to all arguments above, the following attributes are exported:
3232
* `case_sensitive` - Whether the value is case sensitive.
3333
* `delimiter` - The delimiter of the value.
3434
* `include_chinese` - Whether the value include chinese.
35+
* `index_all` - Whether to create indexes for all fields in JSON fields with text values.
3536
* `json_keys` - The JSON subfield key value index.
3637
* `case_sensitive` - Whether the value is case sensitive.
3738
* `delimiter` - The delimiter of the value.

website/docs/r/tls_index.html.markdown

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Provides a resource to manage tls index
1111
## Example Usage
1212
```hcl
1313
resource "volcengine_tls_index" "foo" {
14-
topic_id = "7ce12237-6670-44a7-9d79-2e36961586e6"
14+
topic_id = "227a8d0c-b85b-48df-bee1-0927a595****"
1515
1616
# full_text {
1717
# case_sensitive = true
@@ -25,7 +25,8 @@ resource "volcengine_tls_index" "foo" {
2525
case_sensitive = true
2626
delimiter = "!"
2727
include_chinese = false
28-
sql_flag = false
28+
sql_flag = true
29+
index_all = true
2930
json_keys {
3031
key = "class"
3132
value_type = "text"
@@ -88,6 +89,7 @@ The `key_value` object supports the following:
8889
* `case_sensitive` - (Optional) Whether the value is case sensitive.
8990
* `delimiter` - (Optional) The delimiter of the value.
9091
* `include_chinese` - (Optional) Whether the value include chinese.
92+
* `index_all` - (Optional) Whether to create indexes for all fields in JSON fields with text values. This field is valid when the `value_type` is `json`.
9193
* `json_keys` - (Optional) The JSON subfield key value index.
9294
* `sql_flag` - (Optional) Whether the filed is enabled for analysis.
9395

0 commit comments

Comments
 (0)