当前位置: 首页>>代码示例>>Java>>正文


Java DeleteResponse.getResult方法代码示例

本文整理汇总了Java中org.elasticsearch.action.delete.DeleteResponse.getResult方法的典型用法代码示例。如果您正苦于以下问题:Java DeleteResponse.getResult方法的具体用法?Java DeleteResponse.getResult怎么用?Java DeleteResponse.getResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.action.delete.DeleteResponse的用法示例。


在下文中一共展示了DeleteResponse.getResult方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: delete

import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
@Override
public boolean delete(DeleteRequest request) {
    StopWatch watch = new StopWatch();
    String index = request.index == null ? this.index : request.index;
    boolean deleted = false;
    try {
        DeleteResponse response = client().prepareDelete(index, type, request.id).get();
        deleted = response.getResult() == DocWriteResponse.Result.DELETED;
        return deleted;
    } catch (ElasticsearchException e) {
        throw new SearchException(e);   // due to elastic search uses async executor to run, we have to wrap the exception to retain the original place caused the exception
    } finally {
        long elapsedTime = watch.elapsedTime();
        ActionLogContext.track("elasticsearch", elapsedTime, 0, deleted ? 1 : 0);
        logger.debug("delete, index={}, type={}, id={}, elapsedTime={}", index, type, request.id, elapsedTime);
        checkSlowOperation(elapsedTime);
    }
}
 
开发者ID:neowu,项目名称:core-ng-project,代码行数:19,代码来源:ElasticSearchTypeImpl.java

示例2: remove

import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
@Override
public void remove(String workflowId) {
	try {

		DeleteRequest req = new DeleteRequest(indexName, WORKFLOW_DOC_TYPE, workflowId);
		DeleteResponse response = client.delete(req).actionGet();
		if (response.getResult() == DocWriteResponse.Result.DELETED) {
			log.error("Index removal failed - document not found by id " + workflowId);
		}
	} catch (Throwable e) {
		log.error("Index removal failed failed {}", e.getMessage(), e);
		Monitors.error(className, "remove");
	}
}
 
开发者ID:Netflix,项目名称:conductor,代码行数:15,代码来源:ElasticSearchDAO.java

示例3: delete

import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
public DeleteResponse delete(final String index, final String type,
        final String id,
        final BuilderCallback<DeleteRequestBuilder> builder) {
    final DeleteResponse actionGet = builder
            .apply(client().prepareDelete(index, type, id)).execute()
            .actionGet();
    if (actionGet.getResult() != Result.DELETED) {
        onFailure("Failed to delete " + id + " from " + index + "/" + type
                + ".", actionGet);
    }
    return actionGet;
}
 
开发者ID:codelibs,项目名称:elasticsearch-cluster-runner,代码行数:13,代码来源:ElasticsearchClusterRunner.java

示例4: delById

import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
public boolean delById(String id) {
	DeleteResponse response = client.prepareDelete(INDEX_NAME, TYPE_NAME, id).get();
	return response.getResult() == Result.DELETED;
}
 
开发者ID:TransientBuckwheat,项目名称:nest-spider,代码行数:5,代码来源:SpiderInfoDAO.java

示例5: delete

import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
/**
 * Delete a document for a given id.
 * ATTENTION: deleted documents cannot be re-inserted again if version number
 * checking is used and the new document does not comply to the version number
 * rule. The information which document was deleted persists for one minute and
 * then inserting documents with the same version number as before is possible.
 * To modify this behavior, change the configuration setting index.gc_deletes
 * 
 * @param id
 *            the unique identifier of a document
 * @return true if the document existed and was deleted, false otherwise
 */
public boolean delete(String indexName, String typeName, final String id) {
    DeleteResponse response = elasticsearchClient.prepareDelete(indexName, typeName, id).get();
    return response.getResult() == DocWriteResponse.Result.DELETED;
}
 
开发者ID:yacy,项目名称:yacy_grid_mcp,代码行数:17,代码来源:ElasticsearchClient.java

示例6: deleteById

import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
/**
 * 根据id删除网页模板
 *
 * @param id 网页模板id
 * @return 是否删除
 */
public boolean deleteById(String id) {
    DeleteResponse response = client.prepareDelete(INDEX_NAME, TYPE_NAME, id).get();
    return response.getResult() == DeleteResponse.Result.DELETED;
}
 
开发者ID:bruceq,项目名称:Gather-Platform,代码行数:11,代码来源:SpiderInfoDAO.java

示例7: deleteById

import org.elasticsearch.action.delete.DeleteResponse; //导入方法依赖的package包/类
/**
 * 根据id删除网页
 *
 * @param id 网页id
 * @return 是否删除
 */
public boolean deleteById(String id) {
    DeleteResponse response = client.prepareDelete(INDEX_NAME, TYPE_NAME, id).get();
    return response.getResult() == DeleteResponse.Result.DELETED;
}
 
开发者ID:bruceq,项目名称:Gather-Platform,代码行数:11,代码来源:CommonWebpageDAO.java


注:本文中的org.elasticsearch.action.delete.DeleteResponse.getResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。