自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(56)
  • 收藏
  • 关注

原创 Service 访问方式

第一种方式,是以 Service 的 VIP(Virtual IP,即:虚拟 IP)方式。比如:当我访问 10.0.23.1 这个 Service 的 IP 地址时,10.0.23.1 其实就是一个 VIP,它会把请求转发到该 Service 所代理的某一个 Pod 上.第二种方式,就是以 Service 的 DNS 方式。比如:这时候,只要我访问“my-svc.my-namespace.svc.cluster.local”这条 DNS 记录,就可以访问到名叫 my-svc 的 Service 所代理的

2022-02-25 20:01:43 876

原创 【索引级别分配】

第2题,索引级别分片分配设置Configure hamlet-1 to allocate both primary shards to node2, using the node name通过配置节点名字,指定hamlet-1的俩主分片都放在node2上Configure hamlet-2 so that no primary shard is allocated to node3通过配置,避免hamlet-2的分片放置在node3Remove any allocation filter sett

2021-12-16 16:03:36 316

原创 ES概念区分

source&store(1):_source默认是打开的,将原始文档以JSON的形式存储在_source字段中,在lucene中_source只是一个字段,即在一个字段中存储了一个文档中所有字段的值。_source是es层面的设置,相当于给lucene多加了一个字段用于存储整个原始文档的值。(2):字段中的store属性默认是false,即为不存储该字段;如果该字段的store属性设置为true,则在lucene中该字段的值被单独存储。从以上可知,_source字段和字段属性stor.

2021-12-05 16:27:42 1485

原创 ES数据写入磁盘过程

write -> refresh -> flush write:文档数据到内存缓存,并存到 translog refresh:内存缓存中的文档数据,到文件缓存中的 segment 。此时可以被搜到 flush 是缓存中的 segment 文档数据写入到磁盘 参考:​​​​​​​​​​​​​​ES数据写入磁盘过程 - Poke - 博客园Elasticsearch的数据写入过程 - 简书...

2021-11-28 18:19:36 1097

原创 Elasticsearch数据建模实践建议

DELETE cookie_servicePUT cookie_service/_doc/1{ "url":"www.google.com", "cookies":{ "username":"tom", "age":32 }}PUT cookie_service/_doc/2{ "url":"www.amazon.com", "cookies":{ "login":"2019-01-01", "email":"xyz@abc.com" }...

2021-11-26 23:09:54 764

原创 Elasticsearch数据建模实例

DELETE books#Index 一本书的信息PUT books/_doc/1{ "title":"Mastering ElasticSearch 5.0", "description":"Master the searching, indexing, and aggregation features in ElasticSearch Improve users’ search experience with Elasticsearch’s functionalities and deve..

2021-11-26 22:45:29 924

原创 Ingest Pipeline & Painless Script

DELETE tech_blogs#Blog数据,包含3个字段,tags用逗号间隔PUT tech_blogs/_doc/1{ "title":"Introducing big data......", "tags":"hadoop,elasticsearch,spark", "content":"You know ,for big data"}#测试split tagsPOST _ingest/pipeline/_simulate{ "pipeline": { "...

2021-11-26 21:28:14 955

原创 Update By Query & Reindex API

DELETE blogsPUT blogs/_doc/1{ "content":"Hadoop is cool", "keyword":"hadoop"}#查看MappingGET blogs/_mapping#修改Mapping,增加子字段,使用英文分词器PUT blogs/_mapping{ "properties":{ "content":{ "type":"text", "fields":{ "english":{ ...

2021-11-25 22:05:55 96

原创 文档的父子关系

DELETE my_blogs#设定 Parent/Child MappingPUT my_blogs{ "settings": { "number_of_shards": 2 }, "mappings": { "properties": { "blog_comments_relation":{ "type": "join", "relations":{ "blog":"comment" }...

2021-11-25 21:36:08 57

原创 对象及Nested对象

DELETE blog #设置blog的MappingPUT /blog{ "mappings": { "properties": { "content":{ "type": "text" }, "time":{ "type": "date" }, "user":{ "properties": { "city":{ "type":"tex...

2021-11-25 20:30:04 119

原创 聚合分析的原理及精准度问题

DELETE my_flightsPUT my_flights{ "settings": { "number_of_shards": 20 }, "mappings" : { "properties" : { "AvgTicketPrice" : { "type" : "float" }, "Cancelled" : { "type" : "boolean" }, ...

2021-11-25 19:52:10 102

原创 作用范围与排序

DELETE employeesPUT /employees/{ "mappings" : { "properties" : { "age" : { "type" : "integer" }, "gender" : { "type" : "keyword" }, "job" : { "type" : "text", "fields...

2021-11-25 18:45:57 54

原创 Pipline聚合分析

DELETE employees PUT /employees/_bulk{ "index" : { "_id" : "1" } }{ "name" : "Emma","age":32,"job":"Product Manager","gender":"female","salary":35000 }{ "index" : { "_id" : "2" } }{ "name" : "Underwood","age":41,"job":"Dev Manager","gender":"male...

2021-11-25 18:09:43 59

原创 Bucket&Metric聚合分析及嵌套聚合

DELETE /employeesPUT /employees/{ "mappings": { "properties": { "age":{ "type": "integer" }, "gender":{ "type": "keyword" }, "job":{ "type": "text", "fields": { "keyword":{ ...

2021-11-25 16:07:13 129

原创 处理并发读写操作

DELETE productsPUT productsPUT products/_doc/1{ "title":"iphone", "count":100}GET products/_doc/1PUT products/_doc/1?if_seq_no=0&if_primary_term=1{ "title":"iphone", "count":100}PUT products/_doc/1?if_seq_no=0&if_primary_term...

2021-11-25 00:10:13 1377

原创 排序及Doc Values&Fielddata

//单字段排序POST /kibana_sample_data_ecommerce/_search{ "size": 5, "query": { "match_all": {} }, "sort": [ { "order_date": { "order": "desc" } } ]}//多字段排序POST /kibana_sample_data_ecommerce/_search{ "size": 5,...

2021-11-25 00:01:16 73

原创 分页与遍历:From,Size,Search After &Scroll API

POST movies/_search{ "from":0, "size": 100, "query": { "match_all": {} }}//Search AfterDELETE usersPOST users/_doc{ "name":"user1","age":10}POST users/_doc{ "name":"user2","age":11}POST users/_doc{ "name":"user3","age":12}POST user...

2021-11-25 00:00:59 91

原创 剖析分布式查询及相关性算分

POST message/_doc{ "content":"good"}POST message/_doc{ "content":"good morning"}POST message/_doc{ "content":"good morning everyone"}POST message/_search{ "query": { "term": { "content": { "value": "good" } ...

2021-11-24 22:57:06 53

原创 自动补全与基于上下文的提示

DELETE articlesPUT articles{ "mappings": { "properties": { "title_completion":{ "type": "completion" } } }}POST articles/_bulk{ "index" : { } }{ "title_completion": "lucene is very cool"}{ "index" : { } }{ "title_co...

2021-11-24 20:24:28 243

原创 Term&Phrase Suggester

POST articles/_bulk{ "index":{ }}{"body":"lucene is very cool"}{ "index":{ }}{"body":"Elasticsearch builds on top of lucene"}{ "index":{ }}{"body":"Elasticsearch rocks"}{ "index":{ }}{"body":"elastic is the company behind ELK stack"}{ "index":{ }}

2021-11-24 19:54:43 219

原创 综合排序:Function Score Query优化算分

DELETE blogs PUT /blogs/_doc/1{ "title":"About popularity", "content":"In this post we will talk about...", "votes":0}PUT /blogs/_doc/2{ "title":"About popularity", "content":"In this post we will talk about...", "votes":100}PUT /blogs...

2021-11-24 17:55:22 123

原创 Index Alias查询

PUT movies-2019/_doc/1{ "name":"the matrix", "rating":5}PUT movies-2019/_doc/2{ "name":"Speed", "rating":3}POST _aliases{ "actions": [ { "add": { "index": "movies-2019", "alias": "movies-latest" } }...

2021-11-24 17:40:53 53

原创 单字符串多字段查询:Multi Match

DELETE titlesPUT /titles{ "mappings": { "properties": { "title":{ "type": "text", "analyzer": "english" } } }}POST titles/_bulk{ "index":{"_id":1 }}{ "title":"My dog barks" }{ "index":{"_id":2 }}{ "title":"I...

2021-11-24 16:35:40 85

原创 单字符串多字段查询:Dis Max Query

PUT /blogs/_doc/1{ "title":"Quick brown rabbits", "body":"Brown rabbits are commonly seen."}PUT /blogs/_doc/2{ "title":"Keeping pets healthy", "body":"My quick brown fox eats rabbits on a regular basis."}POST /blogs/_search{ "query": {...

2021-11-24 13:11:53 81

原创 Query&Filtering与多字符串多字段查询

DELETE blogs POST blogs/_bulk{ "index":{"_id":1 }}{"title":"Apple iPad","content":"Apple iPad,Apple iPad" }{ "index":{"_id":2 }}{ "title":"Apple iPad,Apple iPad","content":"Apple iPad"}POST blogs/_search{ "query": { "bool": { "should":...

2021-11-24 12:51:59 62

原创 搜索的相关性算分

PUT testscore/_bulk{ "index":{ "_id":1 }}{"content":"we use Elasticsearch to power the search" }{ "index":{ "_id":2 }}{"content":"we like elasticsearch " }{ "index":{ "_id":3 }}{"content":"The scoring of documents is caculated by the scoring formula

2021-11-24 12:30:13 183

原创 结构化搜索

//结构化搜索,精确匹配DELETE productsPOST /products/_bulk{ "index":{"_id":1 }}{"price":10,"avaliable":true,"date":"2018-01-01","productID":"XHDK-A-1293-#fJ3"}{ "index":{"_id":2 }}{"price":20,"avaliable":true,"date":"2019-01-01","productID":"KDKE-B-9947-#kL5"}

2021-11-24 00:04:14 150

原创 基于词项和基于全文的搜索

POST /products/_bulk{ "index":{ "_id":1 }}{ "productID":"XHDK-A-1293-#fJ3","desc":"iPhone" }{ "index":{ "_id":2 }}{ "productID":"KDKE-B-9947-#kL5","desc":"iPad" }{ "index":{ "_id":3 }}{ "productID":"JODL-X-1937-#pV7","desc":"MBP" }POST /products/_

2021-11-23 23:34:59 43

原创 Elasticsearch聚合分析简介

//#按照目的地进行分桶统计GET kibana_sample_data_flights/_search{ "size": 0, "aggs":{ "flight_dest":{ "terms":{ "field":"DestCountry" } } }}//#查看航班目的地的统计信息,增加平均,最高最低价格GET kibana_sample_data_fli...

2021-11-22 22:30:11 189

原创 Index Template 和Dynamic Template

//数字字符串被映射成text,日期字符串被映射成日期PUT ttemplate/_doc/1{ "someNumber":"1", "someDate":"2019/01/01"}GET ttemplate/_mapping//创建一个默认的templatePUT _template/template_default{ "index_patterns": ["*"], "order": 0, "version": 1, "settings": { "num...

2021-11-22 22:18:48 61

原创 多字段特性及Mapping中配置自定义Analyzer

POST _analyze{ "tokenizer": "keyword", "char_filter": ["html_strip"], "text": "<b>hello world</b>"}//使用char filter进行替换POST _analyze{ "tokenizer": "standard", "char_filter": [{ "type":"mapping", "mappings":["- => _"]...

2021-11-22 21:31:26 129

原创 显示Mapping设置与常见参数介绍

//设置index 为falseDELETE usersPUT users{ "mappings": { "properties": { "firstName":{ "type": "text" }, "lastName":{ "type": "text" }, "mobile":{ "type": "text", "index": false } ...

2021-11-22 20:17:45 509

原创 Dynamic Mapping和常见字段类型

//写入文档,查看mappingPUT mapping_test/_doc/1{ "firstName":"Chan", "lastName":"Jackie", "loginDate":"2018-07-24T10:29:48.103Z"}//查看Mapping文件GET mapping_test/_mapping//DELETE indexDELETE mapping_test//dynamic mapping,推断字段的类型PUT mapping_test/_do...

2021-11-21 19:29:45 193

原创 Query String&Simple Query String查询

PUT /users/_doc/1{ "name":"Ruan Yiming", "about":"java, golang, node, swift, elasticsearch"}PUT /users/_doc/2{ "name":"Li Yiming", "about":"Hadoop"}//query stringPOST users/_search{ "query": { "query_string": { "default_field"...

2021-11-21 19:02:47 1970

原创 Request body与Query DSL

//对日期排序 POST kibana_sample_data_ecommerce/_search { "sort": [ { "order_date": "desc" } ], "query": {"match_all": {} } }//source filtering POST kibana_sample_data_ecommerce/_search { "_source": ["ord...

2021-11-19 23:57:03 136

原创 URI Search

//指定字段查询 带profileGET /movies/_search?q=2012&df=title{ "profile": true}//泛查询,正对_all,所有字段GET /movies/_search?q=2012 "profile": true}//指定字段GET /movies/_search?q=title:2012{ "profile": true}//使用引号 phrase查询GET /movies/_search?q=title:"...

2021-11-19 23:37:01 231

原创 通过Analyzer进行分词

//standrdGET _analyze{ "analyzer": "standard", "text": "2 running Quick brown-foxes leap over lazy dogs in the summer evening."}//simpleGET _analyze{ "analyzer": "simple", "text": "2 running Quick brown-foxes leap over lazy dogs in the summe...

2021-11-19 21:31:13 512

原创 文档的基本CRUD与批量操作

POST与PUT区别:POST理解为新增,PUT理解为更新。因此,在curl -XPUT 中需要指定id。而POST的话,ES会自动创建id。PUT会将新的json值完全替换掉旧的;而POST方式只会更新相同字段的值,其他数据不会改变,新提交的字段若不存在则增加。PUT和DELETE操作是幂等的。所谓幂等是指不管进行多少次操作,结果都一样。比如用PUT修改一篇文章,然后在做同样的操作,每次操作后的结果并没有什么不同,DELETE也是一样。POST操作不是幂等的,比如常见的POST重复加载问题:当..

2021-11-19 20:42:00 444

原创 基本概念:节点、集群、分片及副本

后台启动cerebro: nohup /usr/local/cerebro-0.8.3/bin/cerebro -Dhttp.port=9000 & GET _cluster/healthGET _cat/nodesGET _cat/shards// ctrl + / 跳转官方文档API

2021-11-19 19:22:34 572

原创 基本概念:索引、文档和REST API

//查看索引相关信息GET kibana_sample_data_ecommerce//查看索引的文档总数GET kibana_sample_data_ecommerce/_count//查看前10条文档,了解文档格式POST kibana_sample_data_ecommerce/_search{}//_cat indices API//查看indicesGET /_cat/indices?v&s=index//查看状态为绿的索引GET /_cat/indices

2021-11-19 18:53:46 162

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除