@@ -162,39 +162,35 @@ func testAccMongoDBAtlasSearchIndexConfig(projectID, clusterName string) string
162
162
project_id = "%[1]s"
163
163
name = "%[2]s"
164
164
disk_size_gb = 10
165
-
165
+
166
166
cluster_type = "REPLICASET"
167
167
replication_specs {
168
- num_shards = 1
169
- regions_config {
170
- region_name = "US_EAST_2"
171
- electable_nodes = 3
172
- priority = 7
173
- read_only_nodes = 0
174
- }
168
+ num_shards = 1
169
+ regions_config {
170
+ region_name = "US_EAST_2"
171
+ electable_nodes = 3
172
+ priority = 7
173
+ read_only_nodes = 0
174
+ }
175
175
}
176
-
177
176
backup_enabled = false
178
177
auto_scaling_disk_gb_enabled = false
179
-
178
+
180
179
// Provider Settings "block"
181
180
provider_name = "AWS"
182
181
provider_instance_size_name = "M10"
183
-
184
182
}
185
183
186
184
resource "mongodbatlas_search_index" "test" {
187
- project_id = mongodbatlas_cluster.aws_conf.project_id
188
- cluster_name = mongodbatlas_cluster.aws_conf.name
189
- analyzer = "lucene.simple"
190
- collection_name = "collection_test"
191
- database = "database_test"
185
+ project_id = mongodbatlas_cluster.aws_conf.project_id
186
+ cluster_name = mongodbatlas_cluster.aws_conf.name
187
+ analyzer = "lucene.simple"
188
+ collection_name = "collection_test"
189
+ database = "database_test"
192
190
mappings_dynamic = "true"
193
- name = "name_test"
194
- search_analyzer = "lucene.standard"
191
+ name = "name_test"
192
+ search_analyzer = "lucene.standard"
195
193
}
196
-
197
-
198
194
` , projectID , clusterName )
199
195
}
200
196
@@ -207,13 +203,13 @@ func testAccMongoDBAtlasSearchIndexConfigAdvanced(projectID, clusterName string)
207
203
208
204
cluster_type = "REPLICASET"
209
205
replication_specs {
210
- num_shards = 1
211
- regions_config {
212
- region_name = "US_EAST_2"
213
- electable_nodes = 3
214
- priority = 7
215
- read_only_nodes = 0
216
- }
206
+ num_shards = 1
207
+ regions_config {
208
+ region_name = "US_EAST_2"
209
+ electable_nodes = 3
210
+ priority = 7
211
+ read_only_nodes = 0
212
+ }
217
213
}
218
214
219
215
backup_enabled = false
@@ -226,69 +222,77 @@ func testAccMongoDBAtlasSearchIndexConfigAdvanced(projectID, clusterName string)
226
222
}
227
223
228
224
resource "mongodbatlas_search_index" "test" {
229
- project_id = mongodbatlas_cluster.aws_conf.project_id
230
- cluster_name = mongodbatlas_cluster.aws_conf.name
225
+ project_id = mongodbatlas_cluster.aws_conf.project_id
226
+ cluster_name = mongodbatlas_cluster.aws_conf.name
231
227
232
- analyzer = "lucene.simple"
233
- collection_name = "collection_test"
234
- database = "database_test"
228
+ analyzer = "lucene.simple"
229
+ collection_name = "collection_test"
230
+ database = "database_test"
235
231
mappings_dynamic = false
236
- mappings_fields = <<-EOF
237
- {
238
- "address": {
239
- "type": "document",
240
- "fields": {
241
- "city": {
242
- "type": "string",
243
- "analyzer": "lucene.simple",
244
- "ignoreAbove": 255
245
- },
246
- "state": {
247
- "type": "string",
248
- "analyzer": "lucene.english"
249
- }
232
+ mappings_fields = <<-EOF
233
+ {
234
+ "address":{
235
+ "type":"document",
236
+ "fields":{
237
+ "city":{
238
+ "type":"string",
239
+ "analyzer":"lucene.simple",
240
+ "ignoreAbove":255
241
+ },
242
+ "state":{
243
+ "type":"string",
244
+ "analyzer":"lucene.english"
245
+ }
250
246
}
251
- },
252
- "company": {
253
- "type": "string",
254
- "analyzer": "lucene.whitespace",
255
- "multi": {
256
- "mySecondaryAnalyzer": {
257
- "type": "string",
258
- "analyzer": "lucene.french"
259
- }
247
+ },
248
+ "company":{
249
+ "type":"string",
250
+ "analyzer":"lucene.whitespace",
251
+ "multi":{
252
+ "mySecondaryAnalyzer":{
253
+ "type":"string",
254
+ "analyzer":"lucene.french"
255
+ }
260
256
}
261
- },
262
- "employees": {
263
- "type": "string",
264
- "analyzer": "lucene.standard"
265
- }
257
+ },
258
+ "employees":{
259
+ "type":"string",
260
+ "analyzer":"lucene.standard"
266
261
}
267
- EOF
268
- name = "name_test"
269
- search_analyzer = "lucene.standard"
270
- analyzers = <<-EOF
271
- [{
272
- "name": "index_analyzer_test_name",
273
- "charFilters": [{
274
- "type": "mapping",
275
- "mappings": {"\\" : "/"}
276
- }],
277
- "tokenizer": [{
278
- "type": "nGram",
279
- "minGram": 2,
280
- "maxGram": 5
281
- }],
282
- "tokenFilters": [{
283
- "type": "length",
284
- "min": 20,
285
- "max": 33
286
- }]
287
- }]
262
+ }
263
+ EOF
264
+ name = "name_test"
265
+ search_analyzer = "lucene.standard"
266
+ analyzers = <<-EOF
267
+ [
268
+ {
269
+ "name":"index_analyzer_test_name",
270
+ "charFilters":[
271
+ {
272
+ "type":"mapping",
273
+ "mappings":{
274
+ "\\":"/"
275
+ }
276
+ }
277
+ ],
278
+ "tokenizer":[
279
+ {
280
+ "type":"nGram",
281
+ "minGram":2,
282
+ "maxGram":5s
283
+ }
284
+ ],
285
+ "tokenFilters":[
286
+ {
287
+ "type":"length",
288
+ "min":20,
289
+ "max":33
290
+ }
291
+ ]
292
+ }
293
+ ]
288
294
EOF
289
295
}
290
-
291
-
292
296
` , projectID , clusterName )
293
297
}
294
298
@@ -298,44 +302,42 @@ func testAccMongoDBAtlasSearchIndexConfigSynonyms(projectID, clusterName string)
298
302
project_id = "%[1]s"
299
303
name = "%[2]s"
300
304
disk_size_gb = 10
301
-
305
+
302
306
cluster_type = "REPLICASET"
303
307
replication_specs {
304
- num_shards = 1
305
- regions_config {
306
- region_name = "US_EAST_2"
307
- electable_nodes = 3
308
- priority = 7
309
- read_only_nodes = 0
310
- }
308
+ num_shards = 1
309
+ regions_config {
310
+ region_name = "US_EAST_2"
311
+ electable_nodes = 3
312
+ priority = 7
313
+ read_only_nodes = 0
314
+ }
311
315
}
312
-
316
+
313
317
backup_enabled = false
314
318
auto_scaling_disk_gb_enabled = false
315
-
319
+
316
320
// Provider Settings "block"
317
321
provider_name = "AWS"
318
322
provider_instance_size_name = "M10"
319
-
323
+
320
324
}
321
-
325
+
322
326
resource "mongodbatlas_search_index" "test" {
323
- project_id = mongodbatlas_cluster.test_cluster.project_id
324
- cluster_name = mongodbatlas_cluster.test_cluster.name
325
- analyzer = "lucene.standard"
326
- collection_name = "collection_test"
327
- database = "database_test"
327
+ project_id = mongodbatlas_cluster.test_cluster.project_id
328
+ cluster_name = mongodbatlas_cluster.test_cluster.name
329
+ analyzer = "lucene.standard"
330
+ collection_name = "collection_test"
331
+ database = "database_test"
328
332
mappings_dynamic = "true"
329
- name = "name_test"
330
- search_analyzer = "lucene.standard"
333
+ name = "name_test"
334
+ search_analyzer = "lucene.standard"
331
335
synonyms {
332
- analyzer = "lucene.simple"
333
- name = "synonym_test"
336
+ analyzer = "lucene.simple"
337
+ name = "synonym_test"
334
338
source_collection = "collection_test"
335
339
}
336
340
}
337
-
338
-
339
341
` , projectID , clusterName )
340
342
}
341
343
0 commit comments