diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/10_synonyms_put.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/10_synonyms_put.yml index 93aa45081cd06..e0194fb28711d 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/10_synonyms_put.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/10_synonyms_put.yml @@ -15,18 +15,6 @@ setup: - match: { result: "created" } - # This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time. - - do: - cluster.health: - index: .synonyms-2 - level: shards - wait_for_status: green - timeout: 2m - - - do: - synonyms.get_synonym: - id: test-update-synonyms - - is_true: synonyms_set.0.id - is_true: synonyms_set.1.id @@ -71,7 +59,7 @@ setup: index: .synonyms-2 level: shards wait_for_status: green - timeout: 2m + timeout: 30s - do: synonyms.get_synonym: diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/110_synonyms_invalid.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/110_synonyms_invalid.yml index 819dbedb00a34..640148ce336e2 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/110_synonyms_invalid.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/110_synonyms_invalid.yml @@ -2,6 +2,19 @@ setup: - requires: cluster_features: ["gte_v8.16.0"] reason: Lenient handling of updateable synonyms by default is introduced in 8.16.0 + + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: DEBUG +--- +teardown: + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: INFO --- "Load index with an invalid synonym rule": - do: @@ -11,13 +24,26 @@ setup: synonyms_set: synonyms: "foo => bar, baz" - # This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time. + # This is to ensure that all index shards (write and read) are available. In serverless this can take some time. + - do: + cluster.health: + index: .synonyms-2 + level: shards + timeout: 60s + wait_for_status: green + ignore: 408 + + - do: + cluster.allocation_explain: + body: { "index": ".synonyms-2", "shard": 0, "primary": false } + ignore: 400 + - do: cluster.health: index: .synonyms-2 level: shards + timeout: 20s wait_for_status: green - timeout: 2m - do: indices.create: diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/20_synonyms_get.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/20_synonyms_get.yml index 807467cedd207..b87480733d562 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/20_synonyms_get.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/20_synonyms_get.yml @@ -2,6 +2,13 @@ setup: - requires: cluster_features: ["gte_v8.10.0"] reason: Introduced in 8.10.0 + + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: DEBUG + - do: synonyms.put_synonym: id: test-get-synonyms @@ -14,13 +21,26 @@ setup: - synonyms: "test => check" id: "test-id-3" - # This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time. + # This is to ensure that all index shards (write and read) are available. In serverless this can take some time. + - do: + cluster.health: + index: .synonyms-2 + level: shards + timeout: 60s + wait_for_status: green + ignore: 408 + + - do: + cluster.allocation_explain: + body: { "index": ".synonyms-2", "shard": 0, "primary": false } + ignore: 400 + - do: cluster.health: index: .synonyms-2 level: shards + timeout: 20s wait_for_status: green - timeout: 2m --- "Get synonyms set": @@ -38,7 +58,13 @@ setup: id: "test-id-2" - synonyms: "test => check" id: "test-id-3" - +--- +teardown: + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: INFO --- "Get synonyms set - not found": - do: diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/30_synonyms_delete.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/30_synonyms_delete.yml index f7806a0ef05b5..474d2b54f1811 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/30_synonyms_delete.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/30_synonyms_delete.yml @@ -2,6 +2,13 @@ setup: - requires: cluster_features: ["gte_v8.10.0"] reason: Introduced in 8.10.0 + + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: DEBUG + - do: synonyms.put_synonym: id: test-get-synonyms @@ -12,14 +19,33 @@ setup: - synonyms: "bye => goodbye" id: "test-id-2" - # This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time. + # This is to ensure that all index shards (write and read) are available. In serverless this can take some time. - do: cluster.health: index: .synonyms-2 level: shards + timeout: 60s wait_for_status: green - timeout: 2m + ignore: 408 + - do: + cluster.allocation_explain: + body: { "index": ".synonyms-2", "shard": 0, "primary": false } + ignore: 400 + + - do: + cluster.health: + index: .synonyms-2 + level: shards + timeout: 20s + wait_for_status: green +--- +teardown: + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: INFO --- "Delete synonyms set": - do: diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/40_synonyms_sets_get.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/40_synonyms_sets_get.yml index 025d27ccd4255..fb56bdc4d3825 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/40_synonyms_sets_get.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/40_synonyms_sets_get.yml @@ -2,6 +2,13 @@ setup: - requires: cluster_features: ["gte_v8.10.0"] reason: Introduced in 8.10.0 + + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: DEBUG + - do: synonyms.put_synonym: id: test-synonyms-3 @@ -10,13 +17,26 @@ setup: - synonyms: "hello, hi" - synonyms: "goodbye, bye" - # This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time. + # This is to ensure that all index shards (write and read) are available. In serverless this can take some time. + - do: + cluster.health: + index: .synonyms-2 + level: shards + timeout: 60s + wait_for_status: green + ignore: 408 + + - do: + cluster.allocation_explain: + body: { "index": ".synonyms-2", "shard": 0, "primary": false } + ignore: 400 + - do: cluster.health: index: .synonyms-2 level: shards + timeout: 20s wait_for_status: green - timeout: 2m - do: synonyms.put_synonym: @@ -44,7 +64,7 @@ setup: cluster.health: index: .synonyms-2 level: shards - timeout: 2m + timeout: 30s wait_for_status: green @@ -54,7 +74,7 @@ teardown: cluster.put_settings: body: persistent: - logger.org.elasticsearch.synonyms: null + logger.org.elasticsearch: INFO --- "List synonyms set": - do: diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/50_synonym_rule_put.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/50_synonym_rule_put.yml index b5c8240dc31ac..c0cd866283556 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/50_synonym_rule_put.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/50_synonym_rule_put.yml @@ -2,6 +2,13 @@ setup: - requires: cluster_features: ["gte_v8.10.0"] reason: Introduced in 8.10.0 + + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: DEBUG + - do: synonyms.put_synonym: id: test-synonyms @@ -14,14 +21,33 @@ setup: - synonyms: "test => check" id: "test-id-3" - # This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time. + # This is to ensure that all index shards (write and read) are available. In serverless this can take some time. - do: cluster.health: index: .synonyms-2 level: shards + timeout: 60s wait_for_status: green - timeout: 2m + ignore: 408 + - do: + cluster.allocation_explain: + body: { "index": ".synonyms-2", "shard": 0, "primary": false } + ignore: 400 + + - do: + cluster.health: + index: .synonyms-2 + level: shards + timeout: 20s + wait_for_status: green +--- +teardown: + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: INFO --- "Update a synonyms rule": - do: diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/60_synonym_rule_get.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/60_synonym_rule_get.yml index 67c76292e5ab3..9e952da83e700 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/60_synonym_rule_get.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/60_synonym_rule_get.yml @@ -2,6 +2,13 @@ setup: - requires: cluster_features: ["gte_v8.10.0"] reason: Introduced in 8.10.0 + + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: DEBUG + - do: synonyms.put_synonym: id: test-synonyms @@ -14,12 +21,6 @@ setup: - synonyms: "test => check" id: "test-id-3" - - do: - cluster.put_settings: - body: - persistent: - logger.org.elasticsearch: DEBUG - # This is to ensure that all index shards (write and read) are available. In serverless this can take some time. - do: cluster.health: @@ -32,6 +33,7 @@ setup: - do: cluster.allocation_explain: body: { "index": ".synonyms-2", "shard": 0, "primary": false } + ignore: 400 - do: cluster.health: diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/70_synonym_rule_delete.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/70_synonym_rule_delete.yml index da1ee0e68ecfc..308b8a0d18868 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/70_synonym_rule_delete.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/70_synonym_rule_delete.yml @@ -2,6 +2,11 @@ setup: - requires: cluster_features: ["gte_v8.10.0"] reason: Introduced in 8.10.0 + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: DEBUG - do: synonyms.put_synonym: id: test-synonyms @@ -14,13 +19,26 @@ setup: - synonyms: "test => check" id: "test-id-3" - # This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time. + # This is to ensure that all index shards (write and read) are available. In serverless this can take some time. - do: cluster.health: index: .synonyms-2 level: shards + timeout: 60s + wait_for_status: green + ignore: 408 + + - do: + cluster.allocation_explain: + body: { "index": ".synonyms-2", "shard": 0, "primary": false } + ignore: 400 + + - do: + cluster.health: + index: .synonyms-2 + level: shards + timeout: 20s wait_for_status: green - timeout: 2m --- @@ -52,6 +70,13 @@ setup: id: "test-id-1" - synonyms: "test => check" id: "test-id-3" +--- +teardown: + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: INFO --- "Delete synonym rule - missing synonym set": diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/80_synonyms_from_index.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/80_synonyms_from_index.yml index b7f6136acc4e0..5fdb780df71c2 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/80_synonyms_from_index.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/80_synonyms_from_index.yml @@ -2,7 +2,11 @@ setup: - requires: cluster_features: ["gte_v8.10.0"] reason: Loading synonyms from index is introduced in 8.10.0 - + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: DEBUG # Create a new synonyms set - do: synonyms.put_synonym: @@ -14,13 +18,26 @@ setup: - synonyms: "bye => goodbye" id: "synonym-rule-2" - # This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time. + # This is to ensure that all index shards (write and read) are available. In serverless this can take some time. + - do: + cluster.health: + index: .synonyms-2 + level: shards + timeout: 60s + wait_for_status: green + ignore: 408 + + - do: + cluster.allocation_explain: + body: { "index": ".synonyms-2", "shard": 0, "primary": false } + ignore: 400 + - do: cluster.health: index: .synonyms-2 level: shards + timeout: 20s wait_for_status: green - timeout: 2m # Create an index with synonym_filter that uses that synonyms set - do: @@ -56,6 +73,13 @@ setup: - '{"index": {"_index": "my_index", "_id": "2"}}' - '{"my_field": "goodbye"}' --- +teardown: + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: INFO +--- "Load synonyms from index for an analyzer": # Confirm that synonyms from the synonyms set are used diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/90_synonyms_reloading_for_synset.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/90_synonyms_reloading_for_synset.yml index 35bd7a75a545e..567a4fc8cf0c3 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/90_synonyms_reloading_for_synset.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/90_synonyms_reloading_for_synset.yml @@ -3,7 +3,11 @@ - requires: cluster_features: ["gte_v8.10.0"] reason: Reloading analyzers for specific synonym set is introduced in 8.10.0 - + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: DEBUG # Create synonyms_set1 - do: synonyms.put_synonym: @@ -26,13 +30,26 @@ - synonyms: "bye => goodbye" id: "synonym-rule-2" - # This is to ensure that at least two index shards (write and read) are available. In serverless this can take some time. + # This is to ensure that all index shards (write and read) are available. In serverless this can take some time. + - do: + cluster.health: + index: .synonyms-2 + level: shards + timeout: 60s + wait_for_status: green + ignore: 408 + + - do: + cluster.allocation_explain: + body: { "index": ".synonyms-2", "shard": 0, "primary": false } + ignore: 400 + - do: cluster.health: index: .synonyms-2 level: shards + timeout: 20s wait_for_status: green - timeout: 2m # Create my_index1 with synonym_filter that uses synonyms_set1 - do: @@ -140,3 +157,10 @@ my_field: query: salute - match: { hits.total.value: 0 } +--- +teardown: + - do: + cluster.put_settings: + body: + persistent: + logger.org.elasticsearch: INFO