随笔分类 - ES-学习
摘要:1、批量查询的好处 就是一条一条的查询,比如说要查询100条数据,那么就要发送100次网络请求,这个开销还是很大的 如果进行批量查询的话,查询100条数据,就只要发送1次网络请求,网络请求的性能开销缩减100倍 2、mget的语法 (1)一条一条的查询 GET /test_index/test_ty
阅读全文
摘要:课程大纲 (1)partial update内置乐观锁并发控制 (2)retry_on_conflict (3)_version post /index/type/id/_update?retry_on_conflict=5&version=6
阅读全文
摘要:es,其实是有个内置的脚本支持的,可以基于groovy脚本实现各种各样的复杂操作 基于groovy脚本,如何执行partial update es scripting module,我们会在高手进阶篇去讲解,这里就只是初步讲解一下 PUT /test_index/test_type/11 { "nu
阅读全文
摘要:课程大纲 1、什么是partial update? PUT /index/type/id,创建文档&替换文档,就是一样的语法 一般对应到应用程序中,每次的执行流程基本是这样的: (1)应用程序先发起一个get请求,获取到document,展示到前台界面,供用户查看和修改 (2)用户在前台界面修改数据
阅读全文
摘要:课程大纲 1、上机动手实战演练基于external version进行乐观锁并发控制 external version es提供了一个feature,就是说,你可以不用它提供的内部_version版本号来进行并发控制,可以基于你自己维护的一个版本号来进行并发控制。举个列子,加入你的数据在mysql里
阅读全文
摘要:1、上机动手实战演练基于_version进行乐观锁并发控制 (1)先构造一条数据出来 PUT /test_index/test_type/7 { "test_field": "test test" } (2)模拟两个客户端,都获取到了同一条数据 GET test_index/test_type/7
阅读全文
摘要:1、图解Elasticsearch内部如何基于_version进行乐观锁并发控制 (1)_version元数据 PUT /test_index/test_type/6 { "test_field": "test test" } { "_index": "test_index", "_type": "
阅读全文
摘要:课程大纲 1、深度图解剖析悲观锁与乐观锁两种并发控制方案
阅读全文
摘要:课程大纲 1、深度图解剖析Elasticsearch并发冲突问题
阅读全文
摘要:1、document的全量替换 2、document的强制创建 3、document的删除 1、document的全量替换 (1)语法与创建文档是一样的,如果document id不存在,那么就是创建;如果document id已经存在,那么就是全量替换操作,替换document的json串内容 (
阅读全文
摘要:1、_source元数据 put /test_index/test_type/1 { "test_field1": "test field1", "test_field2": "test field2" } get /test_index/test_type/1 { "_index": "test_
阅读全文
摘要:1、手动指定document id 2、自动生成document id 1、手动指定document id (1)根据应用情况来说,是否满足手动指定document id的前提: 一般来说,是从某些其他的系统中,导入一些数据到es时,会采取这种方式,就是使用系统中已有数据的唯一标识,作为es中doc
阅读全文
摘要:1、_index元数据 2、_type元数据 3、_id元数据 { "_index": "test_index", "_type": "test_type", "_id": "1", "_version": 1, "found": true, "_source": { "test_content":
阅读全文
摘要:课程大纲 1、图解Elasticsearch容错机制:master选举,replica容错,数据恢复 (1)9 shard,3 node (2)master node宕机,自动master选举,red (3)replica容错:新master将replica提升为primary shard,yell
阅读全文
摘要:1、图解横向扩容过程,如何超出扩容极限,以及如何提升容错性 (1)primary&replica自动负载均衡,6个shard,3 primary,3 replica (2)每个node有更少的shard,IO/CPU/Memory资源给每个shard分配更多,每个shard性能更好 (3)扩容的极限
阅读全文
摘要:课程大纲 1、图解2个node环境下replica shard是如何分配的 (1)replica shard分配:3个primary shard,3个replica shard,1 node (2)primary > replica同步 (3)读请求:primary/replica
阅读全文
摘要:1、shard&replica机制再次梳理 2、图解单node环境下创建index是什么样子的 1、shard&replica机制再次梳理 (1)index包含多个shard (2)每个shard都是一个最小工作单元,承载部分数据,lucene实例,完整的建立索引和处理请求的能力 (3)增减节点时,
阅读全文
摘要:课程大纲 1、Elasticsearch对复杂分布式机制的透明隐藏特性 2、Elasticsearch的垂直扩容与水平扩容 3、增减或减少节点时的数据rebalance 4、master节点 5、节点对等的分布式架构 1、Elasticsearch对复杂分布式机制的透明隐藏特性 Elasticsea
阅读全文
摘要:第一个分析需求:计算每个tag下的商品数量 GET /ecommerce/product/_search { "aggs": { "group_by_tags": { "terms": { "field": "tags" } } } } 将文本field的fielddata属性设置为true PUT
阅读全文
摘要:1、query string search 2、query DSL 3、query filter 4、full-text search 5、phrase search 6、highlight search 把英文翻译成中文,让我觉得很别扭,term,词项 1、query string search
阅读全文
浙公网安备 33010602011771号