搜索引擎# Elasticsearch
Elasticsearch实战
I.T10001
用有限的时间创造无限的可能
展开
-
Es6之ik自定义扩展词典(2)
ES6之IK自定义扩展词典原创 2020-01-10 09:13:18 · 48 阅读 · 1 评论 -
es6高可用集群搭建(5)
es6高可用集群搭建原创 2020-01-10 09:12:38 · 75 阅读 · 1 评论 -
es7.16.2基础操作(一)
-- 节点GET _cat/nodes-- 查索引GET _cat/indices-- 批量插入POST customer/external/_bulk{"index":{"_id":1}}{"id":1,"name":"张三","age":10,"sex":"男","email":"zhangsan@gmail.com","address":"湖南省长沙市岳麓区芯城科技园二期8栋"}{"index":{"_id":2}}{"id":2,"name":"李四","age":20,"sex"原创 2021-12-22 21:52:38 · 781 阅读 · 0 评论 -
es7.16.2基础操作(二)
-- 最小精度匹配GET customer/_search{ "query": { "match": { "address": { "query": "长沙", "minimum_should_match": "70%" } } }}-- 最大精度匹配GET customer/_search{ "query": { "dis_max": { "queries": [ {..原创 2021-12-26 14:35:32 · 656 阅读 · 0 评论 -
ES7.16.2基础操作之锁(十八)
###########全局锁################## 创建全局锁PUT /fs/lock/1/_create{"name":"lisi","sex":1}##删除全局锁DELETE /fs/lock/global###########document锁##################1、document锁:对某个doc加锁POST /fs/_update/1{ "upsert": {"process_id": 123}, "script": { "so.原创 2022-01-01 20:03:31 · 763 阅读 · 0 评论 -
ES7.16.2基础操作-评分优化(九)
## 搜索包含java,不包含spark(如果包含spark不会说不需要,而是降低评分)GET customer/_search{ "query": { "boosting": { "positive": { "match": { "introduce": "Java" } }, "negative": { "match": { "introduce": "spar.原创 2021-12-27 18:45:48 · 676 阅读 · 0 评论 -
ES7.16.2基础操作之搜索推荐(七)
## 搜索推荐:match_phrase_prefix## 跟match_phrase原理类似,唯一区别是max_expansions##查询"湖南"开头的,并且包含"栋"字符##max_expansions表示匹配"栋"开头的字符,最多匹配多少个就不匹配了GET customer/_search{ "query": { "match_phrase_prefix": { "address":{ "query": "湖南 栋", "slop".原创 2021-12-27 16:33:31 · 325 阅读 · 0 评论 -
ES7.16.2基础操作之cardinality去重及性能优化(十六)
## cardinality:每个月销售品牌去重统计## precision_threshold优化准确率和内存开销## HyperLogLog++(HLL)算法性能优化GET tvs/_search{ "size": 0, "aggs": { "months": { "date_histogram": { "field": "sold_date", "interval": "month" }, "aggs": {.原创 2022-01-01 15:10:57 · 893 阅读 · 1 评论 -
ES7.16.2基础操作之正则表达式(六)
## 前缀搜索:性能差,尽量前缀长一点GET customer/_search{ "query": { "prefix": { "address.keyword": { "value": "湖南" } } }}## 模糊匹配,性能差:wildcard(?:任意字符,*:0个或任意多个字符)GET customer/_search{ "query": { "wildcard": { "address.key.原创 2021-12-27 16:16:54 · 477 阅读 · 0 评论 -
ES7.16.2高级搜索之搜索模板(二)
##1、简单搜索模板GET blog/_search/template{ "template": { "query": { "match": { "{{field}}": "{{value}}" } } }, "params": { "field":"title", "value":"博客" }}##2、toJson搜索模板GET blog/_search/template{ "template":.原创 2022-01-02 18:45:09 · 622 阅读 · 0 评论 -
ES7.16.2基础操作之percentiles百分比请求时长(十七)
## 初始化数据 POST websit/logs/_bulk {"index":{}} {"latency":105,"province":"湖南","timestamp":"2021-10-28"} {"index":{}} {"latency":60,"province":"广东","timestamp":"2021-12-28"} {"index":{}} {"latency":70,"province":"广西","timestamp":"2021-10-28"} {"index.原创 2022-01-01 15:53:09 · 1671 阅读 · 0 评论 -
ES7.16.2基础操作之搜索推荐ngram(八)
##ngram高性能分词搜索(edge ngram将每个单词切分搜索)##如:hello world,可拆分如下:##h##he##hel##hell##hello##w##wo##wor##worl##world##1、建索引,指定自定义分词器PUT /person{ "settings": { "analysis": { "filter": { "autocomplete_filter":{ "type":"e.原创 2021-12-27 17:13:01 · 1330 阅读 · 0 评论 -
ES7.16.2基础操作之fuzzy模糊搜索(十一)
## fuzzy模糊搜索-自动将拼写错误的文本纠正,然后去匹配## fuzziness表示纠正次数(字符个数)## 常用此方式GET customer/_search{ "query": { "match": { "introduce": { "query": "jbva", "fuzziness": "auto", "operator": "and" } } }}## 不使用此方式GET cu.原创 2021-12-28 13:46:10 · 839 阅读 · 0 评论 -
ES7.16.2高级搜索之自动搜索推荐suggest(三)
##completion suggest搜索推荐,自动提示##索引PUT blog_01{ "mappings": { "properties": { "name":{ "type": "text", "analyzer": "ik_max_word", "fields": { "suggest":{ "type":"completion", "analyzer.原创 2022-01-02 19:03:16 · 1382 阅读 · 0 评论 -
ES7.16.2基础操作之从mysql中动态添加中文热词(十三)
ES7.16.2基础操作之从mysql中动态添加中文热词原创 2021-12-28 15:52:39 · 81 阅读 · 0 评论 -
ES7.16.2基础操作之function_score(十)
## function_score函数,自定义相关度分数算法GET customer/_search{ "query": { "function_score": { "query": { "multi_match": { "query": "java spark", "fields": ["introduce"] } }, "field_value_factor": { .原创 2021-12-28 13:38:26 · 410 阅读 · 0 评论 -
ES7.16.2基础操作之slop查询(三)
## slop移动次数查询:slop==1表示中间间隔几个单词GET customer/_search{ "query": { "match_phrase": { "introduce": { "query": "Java spark", "slop": 1 } } }}原创 2021-12-27 15:01:37 · 2165 阅读 · 0 评论 -
ES7.16.2高级搜索之geo_point地理位置(四)
##geo_point地理位置搜索##索引PUT my_location{ "mappings": { "properties": { "location":{ "type": "geo_point" } } }}##插入数据POST my_location/_bulk{"index":{"_id":2}}{"text":"上海站","location":{"lat":31.256224,"lon":121.462311}.原创 2022-01-02 20:14:50 · 879 阅读 · 0 评论 -
ES7.16.2基础操作之重新打分(五)
## rescore重打分机制:将query中匹配到的50条记录重新打分GET customer/_search{ "query": { "match": { "introduce": "java spark" } }, "rescore": { "query": { "rescore_query": { "match_phrase": { "introduce": { "query.原创 2021-12-27 15:50:11 · 395 阅读 · 0 评论 -
ES7.16.2基础操作之三角原则,近似聚合算法(十五)
ES7.16.2基础操作之三角原则,近似聚合算法原创 2021-12-28 19:01:04 · 32 阅读 · 0 评论 -
ES7.16.2基础操作之近似匹配和精准度匹配相结合(四)
## 精确度查询和近似(模糊)匹配结合## match近似匹配,match_phrase精确匹配GET customer/_search{ "query": { "bool": { "must": [ { "match": { "introduce": "Java spark" } } ], "should": [ { ".原创 2021-12-27 15:27:17 · 928 阅读 · 0 评论 -
ES7.16.2高级搜索之高亮显示(一)
## 创建索引及mappingPUT /blog{ "mappings": { "properties": { "title":{ "type":"text", "analyzer": "ik_max_word" }, "content":{ "type": "text", "analyzer": "ik_max_word" } } }}##查看索引结构GET.原创 2022-01-02 17:23:20 · 1624 阅读 · 0 评论 -
ES7.16.2基础操作之嵌套查询与统计(十四)
## global实现全局/局部销量占比GET tvs/_search{ "size": 0, "query": { "match": { "brand": "长虹" } }, "aggs": { "single_brand_avg_price": { "avg": { "field": "price" } }, "all_avg_price": { "global": {}, .原创 2021-12-28 18:10:34 · 1135 阅读 · 0 评论 -
ES7.16.2基础操作之自定义中文分词(十二)
1、新建一个文件,添加自定义中文,如下图:2、配置自定义文件,如下图:3、重启es4、演示如下:原创 2021-12-28 15:29:08 · 374 阅读 · 0 评论