The delete-by-query plugin adds support for deleteing all of the documents which match the specified query.

It is a replacement for the problematic delete-by-query functionality which has been removed from the Elasticsearch core.

Internally, it uses Scolle and Bluk APIs to delete documents in an efficient and safe manner. It is slower than the old delete-by-query functionality, but fixes the problems with the previous implementation.

TIP:

Queries which match large numbers of documents may run for a long time, as every document had to be deleted individually. Don't use delete-by-query to clean out all or most documents in an index. Rather create a new index and perhaps reindex the document you want to keep.

Installation:

This plugin can be installed by the plugin manager:

bin/plugin install delete-by-query

The plugin must be installed on every node in the cluster, and each node must be restarted after installation.

Removal:

This plugin can be removed with the following command:

bin/plugin remove delete-by-query

The node must be stoped before removing the plugin.

Using delete-by-query

The query can be provided using a simple query string as a paremeter.

curl -XDELETE 'localhost:9200/twitter/tweet/_query?q=user:kimchy&pretty'

Delete-by-query supports deletion accoss multiple indics and multiple types.

IMPORTANT:

Delete by query will only delete the version of the document that was visible to search at the time the request was executed. Any documents that have been reindexed or updated during executiong will not be deleted.

The response record some counters for each index, the counters are as follows:

-found:

-deleted:

-missing: The number of documents that were missing when the plugin tried to delete them. Missing documents were percent when the original query was run, but have already been deleted by another process.

-failed:


Scroll  Docs

While a search request returns a single page of results, the scroll API can be used to get large numbers of results from a single search request, in much the same way as you would use a cursor on a traditional database.

= =!

学英语系列

elasticSearch 2.3 delete-by-query plugin的更多相关文章

  1. elasticsearch 5.x Delete By Query API(根据条件删除)

    之前在 2.X版本里 这个Delete By Query功能被去掉了 因为官方认为会引发一些错误 如需使用 需要自己安装插件. bin/plugin install delete-by-query 需 ...

  2. Elasticsearch学习笔记-Delete By Query API

    记录关于Elasticsearch的文档删除API的学习 首先官网上Document APIs介绍了 Delete API 和Delete By Query API. Delete API可以通过指定 ...

  3. elasticsearch 2.4在head删除数据(使用Delete By Query插件)

    之所以说明是2.4版,是因为不同版本删除的语法不一样(例如跟5.x就不同) 首先安装Delete By Query插件,方式跟安装head插件差不多,安装命令:plugin install delet ...

  4. elasticsearch 基础 —— Delete By Query API

    Delete By Query API _delete_by_query 的简单用法,就是在查询匹配到的每个文档上执行删除.例如: POST twitter/_delete_by_query { &q ...

  5. elasticsearch6.7 05. Document APIs(5)Delete By Query API

    4.Delete By Query API _delete_by_query API可以删除某个匹配条件的文档: POST twitter/_delete_by_query { "query ...

  6. Delete PeopleSoft Query From the Database

    There could be different reasons why a PeopleSoft developer would like to delete a query from the da ...

  7. ElasticSearch query_string vs multi_match cross_fields query

    ElasticSearch query_string vs multi_match cross_fields query 本文记录以字段为中心的查询和以词为中心的查询这两种查询方式的区别以及在Elas ...

  8. How to delete the eclipse plugin.

    click  Help-->installation Details 2. choose the plugin that you want to delete.Then click uninst ...

  9. Elasticsearch查询——布尔查询Bool Query

    Elasticsearch在2.x版本的时候把filter查询给摘掉了,因此在query dsl里面已经找不到filter query了.其实es并没有完全抛弃filter query,而是它的设计与 ...

  10. Unity Dx9 Occlusion Query plugin

    //Occlusion Unity plugin #include "UnityPluginInterface.h" #include <math.h>#include ...

随机推荐

  1. Neural Network Programming - Deep Learning with PyTorch with deeplizard.

    PyTorch Prerequisites - Syllabus for Neural Network Programming Series PyTorch先决条件 - 神经网络编程系列教学大纲 每个 ...

  2. 模糊查询出list

    <resultMap id="shipList" type="com.sinochem.yunlian.yunliantraffic.domain.Ship&quo ...

  3. c# 在.NET使用Newtonsoft.Json转换,读取,写入json

    转自:http://blog.sina.com.cn/s/blog_70686f3a0101kemg.html  首先,大家要明白什么是json,了解更多关于json方面资料大家可以点击https:/ ...

  4. two pointers

    two pointers是算法编程中一种非常重要的思想,但是很少会有教材单独拿出来将,其中一个原因是它更倾向于是一种编程技巧,而长得不太像是一个是“算法”的模样.two pointers的思想十分简介 ...

  5. 【软件安装与环境配置】ubuntu16.04+caffe+nvidia+CUDA+cuDNN安装配置

    前言 博主想使用caffe框架进行深度学习相关网络的训练和测试,刚开始做,特此记录学习过程. 环境配置方面,博主以为最容易卡壳的是GPU的NVIDIA驱动的安装和CUDA的安装,前者尝试的都要吐了,可 ...

  6. 不使用循环或递归判断一个数是否为3的幂(leetcode 326)

    326. Power of ThreeGiven an integer, write a function to determine if it is a power of three. Follow ...

  7. Dart 中dynamic 的使用

    void main(){ var a; a=10; b ="Dart"; dynamic b =20; b ="JavaScript" var list =ne ...

  8. 17python-BS编程

    1.前端概述(1)上网:就是下载网页(2)浏览器:就是一个解释器2.BS模式的了解(1)BS模式:-----b:browser(浏览器)   s:server(服务端)(2)BS模式运行过程:brow ...

  9. Spring MVC中一般类使用service

    在Spring MVC中,Controller中使用service只需使用注解@Resource就行,但是一般类(即不使用@Controller注解的类)要用到service时,可用如下方法: 1.S ...

  10. C语言入门(1)

    开始学习C语言 第一个C语言程序 #include<stdio.h> int main() { printf("Hello World!"); } C程序结构 1. 头 ...