博客
关于我
Elasticsearch 索引字段类型为text,添加keyword类型操作
阅读量:800 次
发布时间:2023-01-24

本文共 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 } ```

转载地址:http://jeeyk.baihongyu.com/

你可能感兴趣的文章
MQTT 持久会话与 Clean Session 详解
查看>>
MQTT工作笔记0007---剩余长度
查看>>
MQTT工作笔记0009---订阅主题和订阅确认
查看>>
Mqtt搭建代理服务器进行通信-浅析
查看>>
MS Edge浏览器“STATUS_INVALID_IMAGE_HASH“兼容性问题
查看>>
ms sql server 2008 sp2更新异常
查看>>
MS UC 2013-0-Prepare Tool
查看>>
MSBuild 教程(2)
查看>>
msbuild发布web应用程序
查看>>
MSB与LSB
查看>>
MSCRM调用外部JS文件
查看>>
MSCRM调用外部JS文件
查看>>
MSEdgeDriver (Chromium) 不适用于版本 >= 79.0.313 (Canary)
查看>>
MsEdgeTTS开源项目使用教程
查看>>
msf
查看>>
MSSQL数据库查询优化(一)
查看>>
MSSQL数据库迁移到Oracle(二)
查看>>
MSSQL日期格式转换函数(使用CONVERT)
查看>>
MSTP多生成树协议(第二课)
查看>>
MSTP是什么?有哪些专有名词?
查看>>