File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -150,3 +150,60 @@ setup:
150150 my_field :
151151 query : salute
152152 - match : { hits.total.value: 0 }
153+
154+ ---
155+ " Reload analyzers with refresh false " :
156+ - requires :
157+ test_runner_features : [ capabilities ]
158+ capabilities :
159+ - method : PUT
160+ path : /_synonyms/{rule_id}
161+ capabilities : [ synonyms_refresh_param ]
162+ reason : " synonyms refresh param capability needed"
163+
164+ - do :
165+ synonyms.put_synonym :
166+ id : synonyms_set1
167+ refresh : false
168+ body :
169+ synonyms_set :
170+ - synonyms : " hello, salute"
171+
172+ - match : { result: "updated" }
173+ - not_exists : reload_analyzers_details
174+
175+ # Confirm that the index analyzers are not reloaded for my_index1
176+ - do :
177+ search :
178+ index : my_index1
179+ body :
180+ query :
181+ match :
182+ my_field :
183+ query : salute
184+ - match : { hits.total.value: 0 }
185+
186+
187+ # This is to ensure that all index shards (write and read) are available. As we won't be using synonyms API to refresh
188+ # analyzers, this can be needed in serverless.
189+ - do :
190+ cluster.health :
191+ index : .synonyms
192+ wait_for_status : green
193+
194+ # Reloading analyzers makes synonyms refresh
195+ - do :
196+ indices.reload_search_analyzers :
197+ index : my_index1
198+ - length : { reload_details: 1 }
199+
200+ - do :
201+ search :
202+ index : my_index1
203+ body :
204+ query :
205+ match :
206+ my_field :
207+ query : salute
208+ - match : { hits.total.value: 1 }
209+
You can’t perform that action at this time.
0 commit comments