public void addDeletion(IndexType indexType, String id) { add(client.prepareDelete(indexType, id).request()); }
public void addDeletion(IndexType indexType, String id, @Nullable String routing) { add(client.prepareDelete(indexType, id).setRouting(routing).request()); }
@Test public void to_string() { assertThat(es.client().prepareDelete("fakes", "fake", "the_id").toString()).isEqualTo("ES delete request of doc the_id in index fakes/fake"); }
@Test public void execute_should_throw_an_unsupported_operation_exception() { try { es.client().prepareDelete("fakes", "fake", "the_id").execute(); fail(); } catch (UnsupportedOperationException e) { assertThat(e).hasMessage("execute() should not be called as it's used for asynchronous"); } } }
@Test public void get_with_string_timeout_is_not_yet_implemented() { try { es.client().prepareDelete("fakes", "fake", "the_id").get("1"); fail(); } catch (UnsupportedOperationException e) { assertThat(e).hasMessage("Not yet implemented"); } }
@Test public void trace_logs() { logTester.setLevel(LoggerLevel.TRACE); es.client().prepareDelete("fakes", "fake", "the_id").get(); assertThat(logTester.logs()).hasSize(1); }
@Test public void get_with_time_value_timeout_is_not_yet_implemented() { try { es.client().prepareDelete("fakes", "fake", "the_id").get(TimeValue.timeValueMinutes(1)); fail(); } catch (UnsupportedOperationException e) { assertThat(e).hasMessage("Not yet implemented"); } }
@Test public void delete() { es.client().prepareDelete("fakes", "fake", "the_id").get(); }
@Test public void proxify_requests() { EsClient underTest = es.client(); assertThat(underTest.nativeClient()).isNotNull(); assertThat(underTest.prepareClusterStats()).isInstanceOf(ProxyClusterStatsRequestBuilder.class); assertThat(underTest.prepareCreate("fakes")).isInstanceOf(ProxyCreateIndexRequestBuilder.class); assertThat(underTest.prepareDelete("fakes", "fake", "my_id")).isInstanceOf(ProxyDeleteRequestBuilder.class); assertThat(underTest.prepareIndicesExist()).isInstanceOf(ProxyIndicesExistsRequestBuilder.class); assertThat(underTest.prepareGet(new IndexType("fakes", "fake"), "1")).isInstanceOf(ProxyGetRequestBuilder.class); assertThat(underTest.prepareHealth()).isInstanceOf(ProxyClusterHealthRequestBuilder.class); assertThat(underTest.prepareNodesStats()).isInstanceOf(ProxyNodesStatsRequestBuilder.class); assertThat(underTest.preparePutMapping()).isInstanceOf(ProxyPutMappingRequestBuilder.class); assertThat(underTest.prepareRefresh()).isInstanceOf(ProxyRefreshRequestBuilder.class); assertThat(underTest.prepareSearch(new IndexType[0])).isInstanceOf(ProxySearchRequestBuilder.class); assertThat(underTest.prepareSearchScroll("1234")).isInstanceOf(ProxySearchScrollRequestBuilder.class); assertThat(underTest.prepareState()).isInstanceOf(ProxyClusterStateRequestBuilder.class); assertThat(underTest.prepareStats()).isInstanceOf(ProxyIndicesStatsRequestBuilder.class); underTest.close(); } }
for (SearchHit hit : hits) { SearchHitField routing = hit.getField("_routing"); DeleteRequestBuilder deleteRequestBuilder = client.prepareDelete(hit.getIndex(), hit.getType(), hit.getId()); if (routing != null) { deleteRequestBuilder.setRouting(routing.getValue());
public void addDeletion(IndexType indexType, String id) { add(client.prepareDelete(indexType, id).request()); }
public void addDeletion(IndexType indexType, String id, @Nullable String routing) { add(client.prepareDelete(indexType, id).setRouting(routing).request()); }
for (SearchHit hit : hits) { SearchHitField routing = hit.getField("_routing"); DeleteRequestBuilder deleteRequestBuilder = client.prepareDelete(hit.getIndex(), hit.getType(), hit.getId()); if (routing != null) { deleteRequestBuilder.setRouting(routing.getValue());