随笔分类 -  es

elasticsearch
摘要:一,创建别名和列出所有别名 import os from elasticsearch import Elasticsearch pwd = os.path.dirname(os.path.realpath(__file__)) ELASTICSEARCH_HOST = 'http://localho 阅读全文
posted @ 2026-02-22 08:21 刘宏缔的架构森林 阅读(2) 评论(0) 推荐(0)
摘要:一,代码: import os from elasticsearch import Elasticsearch pwd = os.path.dirname(os.path.realpath(__file__)) ELASTICSEARCH_HOST = 'http://localhost:9200' 阅读全文
posted @ 2026-02-22 08:15 刘宏缔的架构森林 阅读(4) 评论(0) 推荐(0)
摘要:一,报错信息: { "error": { "root_cause": [ { "type": "security_exception", "reason": "current license is non-compliant for [inference]", "license.expired.fe 阅读全文
posted @ 2025-12-24 16:18 刘宏缔的架构森林 阅读(14) 评论(0) 推荐(0)
摘要:一,命令: GET _inference/_all 效果如下: 阅读全文
posted @ 2025-12-24 15:58 刘宏缔的架构森林 阅读(8) 评论(0) 推荐(0)
摘要:一,minimum_should_match 什么是 minimum_should_match?minimum_should_match 用于指定在 should 子句中至少需要匹配多少个条件才能返回文档。它可以用以下方式表示: 数字:2 表示至少匹配 2 个条件百分比:"60%" 表示至少匹配 6 阅读全文
posted @ 2025-12-18 23:14 刘宏缔的架构森林 阅读(21) 评论(0) 推荐(0)
摘要:一,ik_smart 和 ik_max_word 两种分词器 ik分词插件支持 ik_smart 和 ik_max_word 两种分词器 ik_smart - 粗粒度的分词ik_max_word - 会尽可能的枚举可能的关键词,就是分词比较细致一些,会分解出更多的关键词 二,实际比较的例子: ik_ 阅读全文
posted @ 2025-12-17 22:17 刘宏缔的架构森林 阅读(27) 评论(0) 推荐(0)
摘要:一,查看已安装的plugin $ /opt/soft/elasticsearch-9.2.2/bin/elasticsearch-plugin list $ ls /opt/soft/elasticsearch-9.2.2/plugins/ $ 二,安装: 从这个页面手动下载: https://re 阅读全文
posted @ 2025-12-17 22:09 刘宏缔的架构森林 阅读(41) 评论(0) 推荐(0)
摘要:一,代码: from elasticsearch import Elasticsearch # 连接到 Elasticsearch,替换为实际的 IP 地址和密码 # , basic_auth=('elastic', 'Elastic_j625sz') es = Elasticsearch('htt 阅读全文
posted @ 2025-12-17 20:43 刘宏缔的架构森林 阅读(15) 评论(0) 推荐(0)
摘要:一,代码: from elasticsearch import Elasticsearch # 连接到 Elasticsearch,替换为实际的 IP 地址和密码 # , basic_auth=('elastic', 'Elastic_j625sz') es = Elasticsearch('htt 阅读全文
posted @ 2025-12-17 19:20 刘宏缔的架构森林 阅读(7) 评论(0) 推荐(0)
摘要:一,代码: from elasticsearch import Elasticsearch # 连接到 Elasticsearch,替换为实际的 IP 地址和密码 # , basic_auth=('elastic', 'Elastic_j625sz') es = Elasticsearch('htt 阅读全文
posted @ 2025-12-16 23:13 刘宏缔的架构森林 阅读(12) 评论(0) 推荐(0)
摘要:一,官方文档 https://www.elastic.co/docs/reference/elasticsearch/clients/python 二,安装第三方库 $ pip install elasticsearch 三,代码 from elasticsearch import Elastics 阅读全文
posted @ 2025-12-16 22:47 刘宏缔的架构森林 阅读(10) 评论(0) 推荐(0)
摘要:一,官网下载: 地址:下载页面入口 https://www.elastic.co/cn/downloads/ kibana下载地址: https://www.elastic.co/cn/downloads/kibana 如图: 二,安装 1,解压: $ tar -zxvf kibana-9.2.2- 阅读全文
posted @ 2025-12-14 12:44 刘宏缔的架构森林 阅读(37) 评论(0) 推荐(0)
摘要:一,官网下载: 官网: https://www.elastic.co/platform 二,安装 解压: $ tar -zxvf elasticsearch-9.2.2-linux-x86_64.tar.gz 移动到安装目录: $ mv elasticsearch-9.2.2 /opt/soft/ 阅读全文
posted @ 2025-12-13 16:03 刘宏缔的架构森林 阅读(33) 评论(0) 推荐(0)
摘要:一,问题的表现 当我们在es的索引库中搜索 朝阳新城 时,搜索结果中有包含 朝阳新城 这四个字的结果,也有只包含朝阳或只包含新城的结果,这是analyzer在对关键词做了分词之后从索引库中返回,如果说:我只想要包含朝阳新城这四个字的结果,需要怎么做? 二,解决: 1,默认的match搜索会对搜索内容 阅读全文
posted @ 2024-10-09 19:03 刘宏缔的架构森林 阅读(553) 评论(0) 推荐(1)
摘要:一,删除所有别名 #!/bin/bash # Elasticsearch 地址 ES_HOST="http://localhost:9200" content=$(curl -s -X GET "$ES_HOST/_alias/*") # echo $content # 获取所有alias inde 阅读全文
posted @ 2024-09-27 14:32 刘宏缔的架构森林 阅读(182) 评论(0) 推荐(0)
摘要:一,创建索引: 说明:创建索引时,要使用nested类型 //创建索引库 public function createSecondIndex($client,$indexName) { $params = [ 'index' => $indexName, //索引的名称(mysql的表名) 'bod 阅读全文
posted @ 2024-09-14 10:19 刘宏缔的架构森林 阅读(289) 评论(0) 推荐(0)
摘要:一,添加别名 1,代码: //初始化es的client $client = $this->_init_es(); // 确定参数 $params = [ 'index' => 'gs_second', //索引名字 'name' => 'gs_second_idx', //索引的别名 ]; // 执 阅读全文
posted @ 2024-08-08 14:59 刘宏缔的架构森林 阅读(58) 评论(0) 推荐(0)
摘要:一,查看节点的fs得到索引数据的保存目录 说明: 修改索引数据的保存目录,通常是因为要把数据单独保存到服务器专用的数据盘,方便扩展\管理\备份等 访问: http://localhost:9200/_nodes/stats/fs 也可以从命令行访问: [root@lhdpc elasticsearc 阅读全文
posted @ 2024-08-08 13:48 刘宏缔的架构森林 阅读(545) 评论(0) 推荐(0)
摘要:一,报错: {"index":{"_index":"my_office","_id":"48","status":400 ,"error":{"type":"document_parsing_exception","reason":"[1:1123] failed to parse field [p 阅读全文
posted @ 2024-08-06 16:34 刘宏缔的架构森林 阅读(316) 评论(0) 推荐(0)
摘要:一,判断一个索引库是否存在: $response = $client->indices()->exists(['index' => $this->index_name]); $statusCode = $response->getStatusCode(); var_dump($statusCode) 阅读全文
posted @ 2024-08-05 18:23 刘宏缔的架构森林 阅读(151) 评论(0) 推荐(0)