随笔分类 -  03_ElasticSearch

摘要:elasticsearch-service.bat install elasticsearch-service.bat manager net start 服务名 net stop 服务名 阅读全文
posted @ 2025-12-05 11:48 谷粒-笔记
摘要:Thread pools 线程池 Thread pools 线程池 文档地址:https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-threadpool.html Thread pool types 线程池类型: f 阅读全文
posted @ 2025-06-23 13:45 谷粒-笔记
摘要:Elasticsearch 提供了多种模糊查询方式,适用于不同场景的需求。以下是主要实现方式及其核心特点: 查询类型 适用场景 核心特点 性能影响 Wildcard 通配符匹配(*和?) 类似 SQL 的 LIKE,支持任意位置的通配符,但以*开头时性能较差。适用于非分词的 keyword 类型字段 阅读全文
posted @ 2025-02-08 13:48 谷粒-笔记
摘要:1、添加、修改、删除时注意刷新策略 RefreshPolicy,尽量不要立即刷新 WriteRequest.RefreshPolicy.IMMEDIATE 2、分片数量根据实际机器数量确定 阅读全文
posted @ 2024-07-19 11:05 谷粒-笔记
摘要:REST API { "query": { "bool": { "must": [ { "term": { "sqStatus": { "value": 3, "boost": 1 } } }, { "script": { "script": { "source": "if (doc['finish 阅读全文
posted @ 2024-01-31 15:53 谷粒-笔记
摘要:REST API Java Client BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); boolQueryBuilder.must(QueryBuilders.termQuery("enable", 1)); final 阅读全文
posted @ 2024-01-03 11:35 谷粒-笔记
摘要:1、单个删除文档 rest api DELETE myindex/_doc/1 java client DeleteRequest deleteRequest = new DeleteRequest(index, ElasticsearchConstants.INDEX_TYPE, id); del 阅读全文
posted @ 2023-11-11 10:46 谷粒-笔记
摘要:1、单个更新文档 rest api POST myindex/_update/1 { "doc": { "name": "Smith" } } 不存在则添加,存在则更新 POST myindex/_update/2 { "upsert": { "name": "Alice Smith" } } ja 阅读全文
posted @ 2023-11-11 10:45 谷粒-笔记
摘要:创建空索引 PUT myindex { "settings": { "number_of_shards": 1, "number_of_replicas": 1 }, "mappings": { "properties": { "name": { "type": "keyword", "ignore 阅读全文
posted @ 2023-11-11 10:44 谷粒-笔记
摘要:【ElasticSearch】索引(删除) 阅读全文
posted @ 2023-06-17 16:18 谷粒-笔记
摘要:增加字段 REST API 文档:https://www.elastic.co/guide/en/elasticsearch/reference/7.13/docs-reindex.html 准备一个空索引myindex PUT /myindex { "settings": { "number_of 阅读全文
posted @ 2023-06-17 16:18 谷粒-笔记
摘要:1、REST API 文档:https://www.elastic.co/guide/en/elasticsearch/reference/7.13/indices-create-index.html ignore_above 默认值 256 settings 中的index可以去掉 "settin 阅读全文
posted @ 2023-06-17 16:17 谷粒-笔记
摘要:【ElasticSearch】数据类型 阅读全文
posted @ 2023-04-03 21:44 谷粒-笔记
摘要:1、分组聚合,无子聚合 2、分组聚合,有子聚合 3、多重分组聚合 4、日期聚合 5、统计 6、合计 关于text类型默认是禁止聚合/排序操作的,通过 fielddata=true 开启 PUT cms_search_inside_0d1a60ff-654d-4c1d-9d92-795ff0f9/_m 阅读全文
posted @ 2023-01-06 09:55 谷粒-笔记
摘要:【ElasticSearch】检索文档 阅读全文
posted @ 2022-08-23 15:30 谷粒-笔记
摘要:【ElasticSearch】删除文档 删除单个文档 DELETE get-together/_doc/1 根据条件删除文档 POST get-together/_delete_by_query { "query": { "bool": { "must": [ { "term": { "age": 阅读全文
posted @ 2022-08-23 15:29 谷粒-笔记
摘要:1、根据ID更新文档 1、根据ID更新文档 rest POST myindex/_update/1 { "doc": { "name": "Smith" } } client // 数据 Map<String, String> data = new HashMap<>(); data.put("na 阅读全文
posted @ 2022-08-23 15:29 谷粒-笔记
摘要:1、查询别名 查询所有 GET /_alias 查询单个 GET /admin-service/_alias 2、创建别名 批量创建 POST /_aliases { "actions": [ { "add": { "index": "admin-service", "alias": "admin- 阅读全文
posted @ 2022-08-16 11:32 谷粒-笔记
摘要:1、创建策略【保留日志天数】 2、填写策略名称和其他配置 热阶段,最大存在时间 3 天 可再编辑策略 3、日志索引关联策略 选择自己新建的生命周期策略 阅读全文
posted @ 2022-08-16 10:59 谷粒-笔记
摘要:TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block 磁盘使用量超过洪泛阶段水印,索引具有只读允许删除块 解决:扩充磁盘,重启ES 给磁盘扩容后关闭 阅读全文
posted @ 2022-07-30 22:16 谷粒-笔记