首页 > 其他分享 >Elasticsearch专题精讲—— REST APIs —— Document APIs —— Update By Query API

Elasticsearch专题精讲—— REST APIs —— Document APIs —— Update By Query API

时间:2023-06-06 16:00:15浏览次数:43  
标签:index APIs docs 精讲 update Update API query

REST APIs —— Document APIs ——  Update By Query API

https://www.elastic.co/guide/en/elasticsearch/reference/8.8/docs-update-by-query.html#docs-update-by-query

Updates documents that match the specified query. If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.

更新 API(_update) 允许根据提供的脚本更新文件。该操作从索引中获取文档,运行脚本(使用可选的脚本语言和参数),并对结果进行索引(还允许删除或忽略该操作)。它使用版本控制来确保在 Get 和 Reindex 操作期间没有发生任何更新。

        POST /< target>/_update_by_query

        POST/< target>/_update_by_query 

1、Request(请求)

https://www.elastic.co/guide/en/elasticsearch/reference/8.8/docs-update-by-query.html#docs-update-by-query-api-request

        POST /< index>/_update/<_id>

    POST /< index>/_update/<_id>

2、Prerequisites(先决条件)

https://www.elastic.co/guide/en/elasticsearch/reference/8.8/docs-update-by-query.html#docs-update-by-query-api-prereqs

If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:

如果启用了 Elasticsearch 安全特性,您必须对目标数据流、索引或别名拥有以下索引特权:

    • read
    • index or write

3、Description(描述)

https://www.elastic.co/guide/en/elasticsearch/reference/8.8/docs-update.html#update-api-desc

Enables you to script document updates. The script can update, delete, or skip modifying the document. The update API also supports passing a partial document, which is merged into the existing document. To fully replace an existing document, use the index API.

使能够编写文档更新脚本。脚本可以更新、删除或跳过对文档的修改。更新 API 还支持传递部分文档,该部分文档合并到现有文档中。若要完全替换现有文档,请使用索引 API。

This operation:

标签:index,APIs,docs,精讲,update,Update,API,query
From: https://www.cnblogs.com/zuoyang/p/17460762.html

相关文章

  • Elasticsearch专题精讲—— REST APIs —— Document APIs —— Update API
    RESTAPIs——DocumentAPIs——UpdateAPIhttps://www.elastic.co/guide/en/elasticsearch/reference/8.8/docs-update.htmlUpdatesadocumentusingthespecifiedscript.使用指定的脚本更新文档。1、Request(请求)https://www......
  • @Update执行多条更新语句
    GPT告诉我是这样写的,结果语法错误,我在每个语句中加上分号,依然语法错误 @Update({"UPDATEtable1SETcolumn1=#{value1}WHEREid=#{id};","UPDATEtable2SETcolumn2=#{value2}WHEREid=#{id};"})voidupdateValues(@Param("id"......
  • AtCoder Beginner Contest 287 G Balance Update Query
    洛谷传送门AtCoder传送门线段树上二分入门题。考虑一个贪心:每次询问按\(a_i\)从大到小选。正确性显然。考虑动态开点线段树,每个结点\(a_i\in[l,r]\)存\(\sum\limits_{a_i\in[l,r]}b_i\)和\(\sum\limits_{a_i\in[l,r]}a_ib_i\)。线段树上二分找到第一个\(......
  • 帝国CMS刷新数据表news提示update ***_ecms__index set havehtml=1 where id='' limit
    今天我在进行“数据更新”时,点击“刷新所有信息内容页面”后,在“刷新数据表:article”一项出现提示Table‘empirecms.phome_ecms_’doesn’texist代码如下:Table'www_zwwiki_com.***_ecms_news_data_'doesn'texist;selectkeyid,dokey,newstempid,closepl,infotags,befrom......
  • 关于SQLAlchemy中update的使用参数synchronize_session
    update语句带上synchronize_session="fetch"或者带上synchronize_session=False是啥区别在SQLAlchemy中,当您使用update语句更新数据库中的记录时,可以使用`synchronize_session`参数来指定要同步的会话对象。-当`synchronize_session`设置为`False`时,会话对象不会自动同步,这意......
  • teacher_update
    <%--CreatedbyIntelliJIDEA.User:绿波亭Date:2023/5/29Time:14:51TochangethistemplateuseFile|Settings|FileTemplates.--%><%@pagecontentType="text/html;charset=UTF-8"language="java"%><!DOCTYP......
  • CentOS 7.x安装微服务网关Apache APISIX
    阅读文本大概需要3分钟。    APISIX是一个云原生、高性能、可扩展的微服务API网关。它是基于OpenResty和etcd来实现,和传统API网关相比,APISIX具备动态路由和插件热加载,特别适合微服务体系下的API管理。APISIX通过插件机制,提供动态负载平衡、身份验证、限流限速等功能,并且......
  • es 批量更新 _update_by_query
        {"script":{"source":"ctx._source['owner']=1610"},"query":{"term":{"categoryCId":{"value":807}}}} {"script":{"source":"ctx._source......
  • Elasticsearch专题精讲—— REST APIs —— Document APIs —— Delete by query API
    RESTAPIs——DocumentAPIs——DeletebyqueryAPIhttps://www.elastic.co/guide/en/elasticsearch/reference/8.8/docs-delete-by-query.htmlDeletesdocumentsthatmatchthespecifiedquery.删除与指定查询匹配的文档。curl-XPOS......
  • Elasticsearch专题精讲—— REST APIs —— Document APIs —— Delete API
    RESTAPIs——DocumentAPIs——DeleteAPIRemovesaJSONdocumentfromthespecifiedindex.从指定的索引中移除JSON文档。1、Request(请求)https://www.elastic.co/guide/en/elasticsearch/reference/8.8/docs-delete.......