首页 > 其他分享 >Elasticsearc Cheaper in Bulk

Elasticsearc Cheaper in Bulk

时间:2023-06-01 15:02:00浏览次数:39  
标签:index log bulk same Cheaper Bulk Elasticsearc type event


Cheaper in Bulk

https://www.elastic.co/guide/en/elasticsearch/guide/current/bulk.html

 

Don’t Repeat Yourselfedit

Perhaps you are batch-indexing logging data into the same index, and with the same type. Having to specify the same metadata for every document is a waste. Instead, just as for the mget API, the bulk request accepts a default /_index or /_index/_type in the URL:

POST /website/_bulk
{ "index": { "_type": "log" }}
{ "event": "User logged in" }
 
Copy as cURLView in Sense

You can still override the _index and _type in the metadata line, but it will use the values in the URL as defaults:

POST /website/log/_bulk
{ "index": {}}
{ "event": "User logged in" }
{ "index": { "_type": "blog" }}
{ "title": "Overriding the default type" }

标签:index,log,bulk,same,Cheaper,Bulk,Elasticsearc,type,event
From: https://blog.51cto.com/u_8400305/6394376

相关文章

  • ElasticSearch Shard——本质上是做分布式扩展,副本对于集群的稳定性有很强的影响
    什么是一个Shard?Shard就是一个LuceneIndex,参照文章(深入理解Shard和LuceneIndex)。Index需要多少个Shard?回答这个问题,我们需要先谈谈节点,一个集群有多个节点,具体需要多少个节点合适,是另外一个问题,但是这个数字也会影响我们对Shard数的设置。Shard数=Node数?总体上说,当我们节点数......
  • Skywalking+Elasticsearch安装及应用(邮箱告警)
    1、Skywalking概述Skywalking是一个可观测性分析平台和应用性能管理系统,它也是基于OpenTracing规范、开源的AMP系统。Skywalking提供分布式跟踪、服务网格遥测分析、度量聚合和可视化一体化解决方案。SkyWalking特点:1)多语言自动探针2)为多种......
  • elasticsearch3
    模糊查询#前缀搜索:prefix概念:以xx开头的搜索,不计算相关度评分。注意:前缀搜索匹配的是term,而不是field。前缀搜索的性能很差前缀搜索没有缓存前缀搜索尽可能把前缀长度设置的更长语法:GET<index>/_search{"query":{"prefix":{"<fiel......
  • Elasticsearch专题精讲—— REST APIs —— Document APIs —— 索引API
    RESTAPIs——DocumentAPIs——索引APIhttps://www.elastic.co/guide/en/elasticsearch/reference/8.8/docs-index_.html#docs-index_ AddsaJSONdocumenttothespecifieddatastreamorindexandmakesitsearchable.Ifthetargetisanindexandth......
  • python 从bulkblacklist信誉查询网站提交查询
    importurllibimporturllib2#importwebbrowserimportreimportsocketdefis_domain_in_black_list(domain,ip):try_time=3url="http://www.bulkblacklist.com/"foriinrange(try_time):try:data=......
  • elasticsearch如何安全重启
    elasticsearch如何安全重启节点问题:elasticsearch集群,有时候可能需要修改配置,增加硬盘,扩展内存等操作,需要对节点进行维护升级。但是业务不能停,如果直接kill掉节点,可能导致数据丢失。而且集群会认为该节点挂掉了,就开始转移数据,当重启之后,它又会恢复数据,如果你当前的数据量已经很大......
  • Recovering unassigned shards on elasticsearch 2.x——副本shard可以设置replica为0
    Recoveringunassignedshardsonelasticsearch2.x摘自:https://z0z0.me/recovering-unassigned-shards-on-elasticsearch/Igotaccrosstheproblemwhendecidedtoaddanodetotheelasticsearchclusterandthatnodewasnotabletoreplicatetheindexesofthe......
  • elasticsearch date_histogram
    (5)DateHistogramAggregation时间直方图聚合,专门对时间类型的字段做直方图聚合。这种需求是比较常用见得的,我们在统计时,通常就会按照固定的时间断(1个月或1年等)来做统计。下面统计学校中同一年出生的学生数。curl-XPOST"192.168.1.101:9200/student/student/_search?search_type=c......
  • ElasticSearch使用实例
    当涉及到Elasticsearch的入门实例时,以下是一个详细的示例,展示了如何使用Java高级REST客户端与Elasticsearch进行交互。准备工作:安装Elasticsearch:请按照Elasticsearch官方文档中的说明安装并启动Elasticsearch。添加依赖项:在您的项目的构建文件(例如pom.xml)中,添加Elasticsearc......
  • Elasticsearch专题精讲—— 操作文档 ——读写文档
     操作文档——读写文档1、Introductionhttps://www.elastic.co/guide/en/elasticsearch/reference/8.8/docs-replication.htmlEachindexinElasticsearchisdividedintoshardsandeachshardcanhavemultiplecopies.Thesecopiesareknown......