本文整理汇总了Java中org.elasticsearch.action.delete.DeleteResponse.toString方法的典型用法代码示例。如果您正苦于以下问题:Java DeleteResponse.toString方法的具体用法?Java DeleteResponse.toString怎么用?Java DeleteResponse.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.action.delete.DeleteResponse
的用法示例。
在下文中一共展示了DeleteResponse.toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteDocument
import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
/**
* This method delete the matched Document
*/
@Override
public void deleteDocument() {
try {
client = ESclient.getInstant();
DeleteResponse deleteResponse = client.prepareDelete("school", "tenth", "1")
// .setOperationThreaded(false)
.get();
if (deleteResponse != null) {
deleteResponse.status();
deleteResponse.toString();
log.info("Document has been deleted...");
}
} catch (Exception ex) {
log.error("Exception occurred while delete Document : " + ex, ex);
}
}
示例2: delete
import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
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;
}
示例3: delete
import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
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;
}