随笔分类 -  es

摘要://创建索引库 PUT product_db { "mappings": { "properties": { "id": { "type": "long" }, "name": { "type": "text", "analyzer": "ik_max_word" }, "keywords": { 阅读全文
posted @ 2023-05-30 10:56 小啊菜鸡 阅读(74) 评论(0) 推荐(0) 编辑
摘要:PUT my_index { "mappings": { "my_type": { "properties": { "full_text": { "type": "string" }, "exact_value": { "type": "string", "index": "not_analyzed 阅读全文
posted @ 2021-10-14 17:27 小啊菜鸡 阅读(227) 评论(0) 推荐(0) 编辑
摘要:在 Elasticsearch 5.x 有一个字段折叠(Field Collapsing,#22337)的功能非常有意思,在这里分享一下, 字段折叠是一个很有历史的需求了,可以看这个 issue,编号#256,最初是2010年7月提的issue,也是讨论最多的帖子之一(240+评论),熬了6年才支持 阅读全文
posted @ 2021-08-31 20:14 小啊菜鸡 阅读(2024) 评论(0) 推荐(1) 编辑
摘要:POST news_index/_bulk {"index":{"_id":1}} {"title":"ElasticSearch原理- 神一样的存在"} {"index":{"_id":2}} {"title":"Elasticsearch 快速开始","like":5} {"index":{"_ 阅读全文
posted @ 2020-12-31 16:34 小啊菜鸡 阅读(419) 评论(0) 推荐(0) 编辑
摘要:PUT product_test/_bulk {"index":{"_id":1}} {"name":"A","sales":10,"visitors":10} {"index":{"_id":2}} {"name":"B","sales":20,"visitors":20} {"index":{" 阅读全文
posted @ 2020-12-31 16:32 小啊菜鸡 阅读(392) 评论(0) 推荐(0) 编辑
摘要://启动3个集群 bin/elasticsearch -E node.name=cluster0node -E cluster.name=cluster0 -E path.data=cluster0_data -E discovery.type=single-node -E http.port=92 阅读全文
posted @ 2020-12-28 11:37 小啊菜鸡 阅读(223) 评论(0) 推荐(0) 编辑
摘要:#案例1 DELETE mytest PUT mytest { "settings":{ "number_of_shards":3, "number_of_replicas":0, "index.routing.allocation.require.box_type":"hott" } } # 检查 阅读全文
posted @ 2020-12-28 11:05 小啊菜鸡 阅读(136) 评论(0) 推荐(0) 编辑
摘要:PUT test/_doc/1 { "content":"Hello World" } GET test/_mapping { "test" : { "mappings" : { "properties" : { "content" : { "type" : "text", "fields" : { 阅读全文
posted @ 2020-12-24 09:03 小啊菜鸡 阅读(960) 评论(0) 推荐(0) 编辑
摘要:问题描述: 在配置同义词搜索的时候,如何区分权重.比如,同义词文件中配置"杯子,保温杯",用户在搜索杯子的时候,想让关于杯子的数据展示在前面,或者输入保温杯的时候,想让保温杯的数据展示在前面? PUT /synonym_test/ { "settings": { "analysis": { "ana 阅读全文
posted @ 2020-12-21 10:55 小啊菜鸡 阅读(691) 评论(0) 推荐(0) 编辑
摘要:3、negative boost 搜索包含java,不包含spark的doc,但是这样子很死板搜索包含java,尽量不包含spark的doc,如果包含了spark,不会说排除掉这个doc,而是说将这个doc的分数降低包含了negative term的doc,分数乘以negative boost,分数 阅读全文
posted @ 2020-12-17 15:33 小啊菜鸡 阅读(415) 评论(0) 推荐(0) 编辑
摘要:PUT /blogs/_doc/1 { "title": "About popularity", "content": "In this post we will talk about...", "votes": 0 } PUT /blogs/_doc/2 { "title": "About pop 阅读全文
posted @ 2020-12-17 14:57 小啊菜鸡 阅读(238) 评论(0) 推荐(0) 编辑
摘要:课程大纲 1、搜索title或content中包含java beginner的帖子 GET /forum/article/_search { "query": { "dis_max": { "queries": [ { "match": { "title": "java beginner" }}, 阅读全文
posted @ 2020-12-17 14:55 小啊菜鸡 阅读(577) 评论(1) 推荐(0) 编辑
摘要:同义词的配置如下: 杯子,保温杯 PUT tongyiciv2{ "settings": { "analysis": { "filter": { "word_sync": { "type": "synonym", "synonyms_path": "analysis/synonym.txt" } } 阅读全文
posted @ 2020-12-17 11:23 小啊菜鸡 阅读(1502) 评论(0) 推荐(0) 编辑
摘要:比如我搜star,是指star wars,还是指starbucks #上下文 contexts PUT comments { "mappings": { "properties": { "comment_autocomplete":{ "type": "completion", "contexts" 阅读全文
posted @ 2020-12-16 20:35 小啊菜鸡 阅读(193) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示