摘要: 参数如下: ``` { "size": 10000, "query": { "bool": { "must": [ { "range": { "dateTime": { "from": "2022-09-21", "to": "2022-09-22", "include_lower": true, 阅读全文
posted @ 2023-08-05 16:01 aaacarrot 阅读(520) 评论(0) 推荐(0) 编辑
摘要: 通过 Elasticsearch 的 RESTFul API 来创建索引: PUT http://{host}:9200/{index} > 默认情况下,创建的索引分片数量是 5 个,副本数量是 1 个。 如果要指定分片数、副本数量: ``` { "settings": { "number_of_s 阅读全文
posted @ 2023-08-05 15:35 aaacarrot 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 1、term 查询是基于字段的精确匹配查询,不应用分词器。 match 查询是全文搜索查询,对搜索字符串和字段内容都应用相同的分词器,并使用布尔逻辑进行匹配。 2、match:会使用分词器,对全文进行匹配搜索(模糊搜索), 要注意的是,Keyword 不会做分词的。 所以如果是用在keyword上面 阅读全文
posted @ 2023-08-05 15:30 aaacarrot 阅读(1062) 评论(0) 推荐(0) 编辑