Skip to content

Commit 509bd09

Browse files
committed
adjust cls index example
1 parent d411ee3 commit 509bd09

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

tencentcloud/services/cls/resource_tc_cls_index.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ resource "tencentcloud_cls_topic" "example" {
2525
}
2626
}
2727
28+
locals {
29+
tokenizer_value = "@&?|#()='\",;:<>[]{}"
30+
}
31+
2832
resource "tencentcloud_cls_index" "example" {
2933
topic_id = tencentcloud_cls_topic.example.id
3034
3135
rule {
3236
full_text {
3337
case_sensitive = true
34-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
38+
tokenizer = local.tokenizer_value
3539
contain_z_h = true
3640
}
3741
@@ -42,7 +46,7 @@ resource "tencentcloud_cls_index" "example" {
4246
value {
4347
contain_z_h = true
4448
sql_flag = true
45-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
49+
tokenizer = local.tokenizer_value
4650
type = "text"
4751
}
4852
}
@@ -52,7 +56,7 @@ resource "tencentcloud_cls_index" "example" {
5256
value {
5357
contain_z_h = true
5458
sql_flag = true
55-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
59+
tokenizer = local.tokenizer_value
5660
type = "text"
5761
}
5862
}
@@ -65,7 +69,7 @@ resource "tencentcloud_cls_index" "example" {
6569
value {
6670
contain_z_h = true
6771
sql_flag = true
68-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
72+
tokenizer = local.tokenizer_value
6973
type = "text"
7074
}
7175
}

tencentcloud/services/cls/resource_tc_cls_inex_test.go renamed to tencentcloud/services/cls/resource_tc_cls_index_test.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,17 @@ resource "tencentcloud_cls_topic" "example" {
6464
}
6565
}
6666
67+
locals {
68+
tokenizer_value = "@&?|#()='\",;:<>[]{}"
69+
}
70+
6771
resource "tencentcloud_cls_index" "example" {
6872
topic_id = tencentcloud_cls_topic.example.id
6973
7074
rule {
7175
full_text {
7276
case_sensitive = true
73-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
77+
tokenizer = local.tokenizer_value
7478
contain_z_h = true
7579
}
7680
@@ -81,7 +85,7 @@ resource "tencentcloud_cls_index" "example" {
8185
value {
8286
contain_z_h = true
8387
sql_flag = true
84-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
88+
tokenizer = local.tokenizer_value
8589
type = "text"
8690
}
8791
}
@@ -91,7 +95,7 @@ resource "tencentcloud_cls_index" "example" {
9195
value {
9296
contain_z_h = true
9397
sql_flag = true
94-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
98+
tokenizer = local.tokenizer_value
9599
type = "text"
96100
}
97101
}
@@ -104,7 +108,7 @@ resource "tencentcloud_cls_index" "example" {
104108
value {
105109
contain_z_h = true
106110
sql_flag = true
107-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
111+
tokenizer = local.tokenizer_value
108112
type = "text"
109113
}
110114
}
@@ -143,13 +147,17 @@ resource "tencentcloud_cls_topic" "example" {
143147
}
144148
}
145149
150+
locals {
151+
tokenizer_value = "@&?|#()='\",;:<>[]{}"
152+
}
153+
146154
resource "tencentcloud_cls_index" "example" {
147155
topic_id = tencentcloud_cls_topic.example.id
148156
149157
rule {
150158
full_text {
151159
case_sensitive = true
152-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
160+
tokenizer = local.tokenizer_value
153161
contain_z_h = true
154162
}
155163
@@ -160,7 +168,7 @@ resource "tencentcloud_cls_index" "example" {
160168
value {
161169
contain_z_h = true
162170
sql_flag = true
163-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
171+
tokenizer = local.tokenizer_value
164172
type = "text"
165173
}
166174
}
@@ -170,7 +178,7 @@ resource "tencentcloud_cls_index" "example" {
170178
value {
171179
contain_z_h = true
172180
sql_flag = true
173-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
181+
tokenizer = local.tokenizer_value
174182
type = "text"
175183
}
176184
}
@@ -183,7 +191,7 @@ resource "tencentcloud_cls_index" "example" {
183191
value {
184192
contain_z_h = true
185193
sql_flag = true
186-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
194+
tokenizer = local.tokenizer_value
187195
type = "text"
188196
}
189197
}

website/docs/r/cls_index.html.markdown

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ resource "tencentcloud_cls_topic" "example" {
3636
}
3737
}
3838
39+
locals {
40+
tokenizer_value = "@&?|#()='\",;:<>[]{}"
41+
}
42+
3943
resource "tencentcloud_cls_index" "example" {
4044
topic_id = tencentcloud_cls_topic.example.id
4145
4246
rule {
4347
full_text {
4448
case_sensitive = true
45-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
49+
tokenizer = local.tokenizer_value
4650
contain_z_h = true
4751
}
4852
@@ -53,7 +57,7 @@ resource "tencentcloud_cls_index" "example" {
5357
value {
5458
contain_z_h = true
5559
sql_flag = true
56-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
60+
tokenizer = local.tokenizer_value
5761
type = "text"
5862
}
5963
}
@@ -63,7 +67,7 @@ resource "tencentcloud_cls_index" "example" {
6367
value {
6468
contain_z_h = true
6569
sql_flag = true
66-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
70+
tokenizer = local.tokenizer_value
6771
type = "text"
6872
}
6973
}
@@ -76,7 +80,7 @@ resource "tencentcloud_cls_index" "example" {
7680
value {
7781
contain_z_h = true
7882
sql_flag = true
79-
tokenizer = "@&?|#()='\",;:<>[]{}/ \n\t\r\\"
83+
tokenizer = local.tokenizer_value
8084
type = "text"
8185
}
8286
}

0 commit comments

Comments
 (0)