elasticSearch 2.3 delete-by-query plugin

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.

= =!

学英语系列

时间: 2024-10-16 02:22:44

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

Elasticsearch的javaAPI之facet,count,delete by query

Elasticsearch的javaAPI之count count API允许轻松地执行一个查询,获得匹配的数量,可以跨越一个或多个index ,一个或多个type. import static org.elasticsearch.index.query.xcontent.FilterBuilders.*; import static org.elasticsearch.index.query.xcontent.QueryBuilders.*; CountResponse response =

Elasticsearch Index API & Aggregations API & Query DSL

这篇小菜给大家演示和讲解一些Elasticsearch的API,如在工作中用到时,方便查阅. 一.Index API 创建索引库 curl -XPUT 'http://127.0.0.1:9200/test_index/' -d '{     "settings" : {       "index" : {       "number_of_shards" : 3,       "number_of_replicas" : 1

Spring Boot 整合 Elasticsearch,实现 function score query 权重分查询

运行环境:JDK 7 或 8,Maven 3.0+技术栈:SpringBoot 1.5+,ElasticSearch 2.3.2 本文提纲一.ES 的使用场景二.运行 springboot-elasticsearch 工程三.springboot-elasticsearch 工程代码详解 一.ES 的使用场景 简单说,ElasticSearch(简称 ES)是搜索引擎,是结构化数据的分布式搜索引擎.在<Elasticsearch 和插件 elasticsearch-head 安装详解>  和

ElasticSearch(五) Delete API

一.根据查询结果删除(Delete By Query API) BulkByScrollResponse response = DeleteByQueryAction.INSTANCE.newRequestBuilder(client)   // transport client .filter(QueryBuilders.matchQuery("gender", "male"))    //查询条件 .source("persons")    

ElasticSearch学习文档2018.11

1       Elasticsearch安装 1.1    ES6.0版本安装head插件 1.1 下载head插件 下载地址:https://github.com/mobz/elasticsearch-head:点击clone or download按钮 1.2  安装node.js 下载地址:https://nodejs.org/en/download/ 1.3  安装grunt 运行head需要借助grunt命令 ,但是安装grunt需要借助npm 进入nodejs安装根目录,输入以下命

Elasticsearch Java API简要总汇

3.1 集群的连接 3.1.1 作为Elasticsearch节点 [html] view plain copy 代码: import static org.elasticsearch.node.NodeBuilder.nodeBuilder; import org.elasticsearch.client.Client; import org.elasticsearch.node.Node; Node node = nodeBuilder().clusterName("escluster2&q

Elasticsearch: Indexing SQL databases. The easy way

Elasticsearchis a great search engine, flexible, fast and fun. So how can I get started with it? This post will go through how to get contents from a SQL database into Elasticsearch. Elasticsearch has a set of pluggable services called rivers. A rive

ElasticSearch搜索引擎使用&mdash;从0到1

阅读目录: 背景 安装 查找.下载rpm包 .执行rpm包安装 配置elasticsearch专属账户和组 设置elasticsearch文件所有者 切换到elasticsearch专属账户测试能否成功启动 安装自启动elasticsearch servicewrapper包 下载elasticsearch servicewrapper 包 elasticsearch servicewrapper开源包的配置小bug servicewrapper安装 chkconfig -add 加入linux

ElasticSearch大数据分布式弹性搜索引擎使用

阅读目录: 背景 安装 查找.下载rpm包 .执行rpm包安装 配置elasticsearch专属账户和组 设置elasticsearch文件所有者 切换到elasticsearch专属账户测试能否成功启动 安装自启动elasticsearch servicewrapper包 下载elasticsearch servicewrapper 包 elasticsearch servicewrapper开源包的配置小bug servicewrapper安装 chkconfig -add 加入linux