摘要: 1、什么是分词器 切分词语,normalization(提升recall召回率) 给你一段句子,然后将这段句子拆分成一个一个的单个的单词,同时对每个单词进行normalization(时态转换,单复数转换) recall,召回率:搜索的时候,增加能够搜索到的结果的数量 character filte 阅读全文
posted @ 2018-08-30 14:27 Kero小柯 阅读(1399) 评论(0) 推荐(0) 编辑
摘要: 1、重建索引 一个field的设置是不能被修改的,如果要修改一个Field,那么应该重新按照新的mapping,建立一个index,然后将数据批量查询出来,重新用bulk api写入index中 批量查询的时候,建议采用scroll api,并且采用多线程并发的方式来reindex数据,每次scol 阅读全文
posted @ 2018-08-30 14:27 Kero小柯 阅读(2524) 评论(1) 推荐(0) 编辑
摘要: PUT /website/article/1 { "post_date": "2017-01-01", "title": "my first article", "content": "this is my first article in this website", "author_id": 1 阅读全文
posted @ 2018-08-30 14:26 Kero小柯 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 1、批量查询的好处 就是一条一条的查询,比如说要查询100条数据,那么就要发送100次网络请求,这个开销还是很大的 如果进行批量查询的话,查询100条数据,就只要发送1次网络请求,网络请求的性能开销缩减100倍 mget的语法 mget批量查询 GET /_mget { "docs" : [ { " 阅读全文
posted @ 2018-08-30 14:25 Kero小柯 阅读(3302) 评论(0) 推荐(0) 编辑
摘要: _source元数据 put /test_index/test_type/1 { "test_field1": "test field1", "test_field2": "test field2" } get /test_index/test_type/1 { "_index": "test_in 阅读全文
posted @ 2018-08-30 14:25 Kero小柯 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 计算每个tag下的商品数量 GET /ecommerce/product/_search { "aggs": { //聚合 "group_by_tags": { //聚合任意名字 "terms": { "field": "tags" } //terms分组字段得到分组数量 } } } 对名称中包含y 阅读全文
posted @ 2018-08-30 14:24 Kero小柯 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 简要 1、query string search2、query DSL3、query filter4、full-text search5、phrase search6、highlight search 1、query string search 搜索全部商品:GET /ecommerce/produ 阅读全文
posted @ 2018-08-30 14:22 Kero小柯 阅读(12429) 评论(0) 推荐(3) 编辑
摘要: (1)新增商品:新增文档,建立索引 PUT /index/type/id{ "json数据"} PUT /ecommerce/product/1{ "name" : "gaolujie yagao", "desc" : "gaoxiao meibai", "price" : 30, "produce 阅读全文
posted @ 2018-08-30 14:10 Kero小柯 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1.在windows上安装和启动Elasticseach 1、安装JDK,至少1.8.0_73以上版本,java -version2、下载和解压缩Elasticsearch安装包。Elasticsearch和Kibana的版本必须一致,这里都是使用elasticsearch-5.2.0.zip和ki 阅读全文
posted @ 2018-08-30 14:03 Kero小柯 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 1.elasticsearch的核心概念 (1)Near Realtime(NRT):近实时,两个意思,从写入数据到数据可以被搜索到有一个小延迟(大概1秒);基于es执行搜索和分析可以达到秒级 (2)Cluster:集群,包含多个节点,每个节点属于哪个集群是通过一个配置(集群名称,默认是elasti 阅读全文
posted @ 2018-08-30 14:00 Kero小柯 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 1.简介 Elasticsearch,分布式,高性能,高可用,可伸缩的搜索和分析系统 2.什么是全文检索和Lucene? (1)全文检索,倒排索引(2)lucene,就是一个jar包,里面包含了封装好的各种建立倒排索引,以及进行搜索的代码,包括各种算法。我们就用java开发的时候,引入lucene 阅读全文
posted @ 2018-08-30 13:52 Kero小柯 阅读(355) 评论(0) 推荐(1) 编辑