File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed
client/rest-high-level/src
main/java/org/elasticsearch/client
test/java/org/elasticsearch/client Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -203,12 +203,7 @@ Params withRefresh(boolean refresh) {
203203
204204 Params withRefreshPolicy (WriteRequest .RefreshPolicy refreshPolicy ) {
205205 if (refreshPolicy != WriteRequest .RefreshPolicy .NONE ) {
206- // TODO use refreshPolicy.toString() once it returns the appropriate value
207- if (refreshPolicy == WriteRequest .RefreshPolicy .IMMEDIATE ) {
208- putParam ("refresh" , Boolean .TRUE .toString ());
209- } else {
210- putParam ("refresh" , "wait_for" );
211- }
206+ putParam ("refresh" , refreshPolicy .getValue ());
212207 }
213208 return this ;
214209 }
Original file line number Diff line number Diff line change @@ -235,12 +235,7 @@ public void testIndex() throws IOException {
235235 WriteRequest .RefreshPolicy refreshPolicy = randomFrom (WriteRequest .RefreshPolicy .values ());
236236 indexRequest .setRefreshPolicy (refreshPolicy );
237237 if (refreshPolicy != WriteRequest .RefreshPolicy .NONE ) {
238- // TODO use refreshPolicy.toString() once it returns the appropriate value
239- if (refreshPolicy == WriteRequest .RefreshPolicy .IMMEDIATE ) {
240- expectedParams .put ("refresh" , Boolean .TRUE .toString ());
241- } else {
242- expectedParams .put ("refresh" , "wait_for" );
243- }
238+ expectedParams .put ("refresh" , refreshPolicy .getValue ());
244239 }
245240 }
246241 }
You can’t perform that action at this time.
0 commit comments