Java Code Examples for org.elasticsearch.action.delete.DeleteRequest#type()

The following examples show how to use org.elasticsearch.action.delete.DeleteRequest#type() . 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: EsUtil.java    From java-study with Apache License 2.0 6 votes vote down vote up
/**
 * @return boolean
 * @Author pancm
 * @Description //删除数据
 * 根据ID进行单条删除
 * @Date 2019/3/21
 * @Param []
 **/
public static boolean deleteById(String index, String type, String id) throws IOException {
    if (index == null || type == null || id == null) {
        return true;
    }
    try {
        DeleteRequest deleteRequest = new DeleteRequest();
        deleteRequest.id(id);
        deleteRequest.index(index);
        deleteRequest.type(type);
        // 同步删除
        client.delete(deleteRequest, RequestOptions.DEFAULT);
    } finally {
        if (isAutoClose) {
            close();
        }
    }
    return true;
}
 
Example 2
Source File: BookingDaoESImp.java    From blue-marlin with Apache License 2.0 5 votes vote down vote up
@Override
public void unlockBooking() throws IOException
{
    DeleteRequest deleteRequest = new DeleteRequest(this.bookingsIndex);
    deleteRequest.type(ES_TYPE);
    deleteRequest.id(LOCK_BOOKING_ID);
    this.esclient.delete(deleteRequest);
}
 
Example 3
Source File: BookingDaoESImp.java    From blue-marlin with Apache License 2.0 5 votes vote down vote up
@Override
public void removeBookingBucket(BookingBucket bookingBucket) throws IOException
{
    DeleteRequest deleteRequest = new DeleteRequest(this.bookingBucketsIndex);
    deleteRequest.type(ES_TYPE);
    deleteRequest.id(bookingBucket.getId());
    this.esclient.delete(deleteRequest);
}