Java Code Examples for org.elasticsearch.action.delete.DeleteResponse#toString()

The following examples show how to use org.elasticsearch.action.delete.DeleteResponse#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfService.java    From SkaETL with Apache License 2.0 5 votes vote down vote up
private void callRemoveES(ConfigurationLogstash cl) throws IOException {
    DeleteRequest deleteRequest = new DeleteRequest(INDEX_STORAGE, "doc", cl.getIdEs());
    DeleteResponse deleteResponse = restHighLevelClient.delete(deleteRequest);
    if (deleteResponse != null) {
        deleteResponse.status();
        deleteResponse.toString();
        cl.setIdEs(null);
    }
}
 
Example 2
Source File: ElasticsearchHighRestFactory.java    From database-transform-tool with Apache License 2.0 5 votes vote down vote up
public String delete(String index,String type,String id){
	try {
		if(xclient==null){
			init();
		}
		DeleteRequest request = new DeleteRequest(index, type, id);
		DeleteResponse result = xclient.delete(request);
		return result.toString();
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return null;
}
 
Example 3
Source File: ElasticsearchTransportFactory.java    From database-transform-tool with Apache License 2.0 5 votes vote down vote up
public String delete(String index,String type,String id){
	try {
		if(client==null){
			init();
		}
		DeleteResponse result = client.prepareDelete(index, type, id).execute().actionGet();
		System.out.println(JSON.toJSONString(result));
		return result.toString();
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return null;
}
 
Example 4
Source File: AdapterActionFutureActionGetMethodsInterceptor.java    From skywalking with Apache License 2.0 5 votes vote down vote up
private void parseDeleteResponse(DeleteResponse deleteResponse, AbstractSpan span) {
    if (TRACE_DSL) {
        String tagValue = deleteResponse.toString();
        tagValue = ELASTICSEARCH_DSL_LENGTH_THRESHOLD > 0 ? StringUtil.cut(tagValue, ELASTICSEARCH_DSL_LENGTH_THRESHOLD) : tagValue;
        Tags.DB_STATEMENT.set(span, tagValue);
    }
}