
Elasticsearch 索引字段类型为text,添加keyword类型操作
发布日期:2025-03-29 19:07:06
浏览次数:6
分类:精选文章
本文共 500 字,大约阅读时间需要 1 分钟。
1. 查看索引类型结构
为了查看索引的类型结构,可以执行以下命令: `GET /my_index/_mapping` 返回结果: ```json { "my_index": { "mappings": { "_meta": {}, "_source": { "includes": [], "excludes": [] }, "numeric_detection": false, "properties": { "my_field": { "type": "text" } } } } } ```2. 添加Keyword类型
为了添加Keyword类型,可以执行以下 PUT 请求: `PUT /my_index/_mapping` 请求体: ```json { "properties": { "my_field": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } } } } ``` 返回结果: ```json { "acknowledged": true } ```发表评论
最新留言
路过,博主的博客真漂亮。。
[***.116.15.85]2025年05月06日 23时53分43秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
EJB学习笔记六(EJB中的拦截器)
2023-01-24
el-form表单重置后输入失效
2023-01-24
el-select下拉框修改背景色
2023-01-24
el-table select事件判断当前项是否勾选
2023-01-24
Elasticsearch & Kibana & Filebeat开启SSL通信
2023-01-24
ElasticSearch - DSL查询文档语法,以及深度分页问题、解决方案
2023-01-24
ElasticSearch - 分布式搜索引擎底层实现——倒排索引
2023-01-24
ElasticSearch - 基于 JavaRestClient 操作索引库和文档
2023-01-24
ElasticSearch - 基础概念,以及和 mysql 的对比
2023-01-24
ElasticSearch - 索引库和文档相关命令操作
2023-01-24
elasticsearch 7.7.0 单节点配置x-pack
2023-01-24
ElasticSearch 中 REST API 详解
2023-01-24
Hot100之回溯算法
2023-01-24