博客
关于我
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/

你可能感兴趣的文章
NetworkX:是否为每个节点添加超链接?
查看>>
network小学习
查看>>
Netwox网络工具使用详解
查看>>
Net与Flex入门
查看>>
Net任意String格式转换为DateTime类型
查看>>
net包之IPConn
查看>>
net发布的dll方法和类显示注释信息(字段说明信息)[图解]
查看>>
Net和T-sql中的日期函数操作
查看>>
Net处理html页面元素工具类(HtmlAgilityPack.dll)的使用
查看>>
Net操作Excel(终极方法NPOI)
查看>>
Net操作配置文件(Web.config|App.config)通用类
查看>>
net网络查看其参数state_dict,data,named_parameters
查看>>
Net连接mysql的公共Helper类MySqlHelper.cs带MySql.Data.dll下载
查看>>
NeurIPS(神经信息处理系统大会)-ChatGPT4o作答
查看>>
neuroph轻量级神经网络框架
查看>>
Neutron系列 : Neutron OVS OpenFlow 流表 和 L2 Population(7)
查看>>
new Blob()实现不同类型的文件下载功能
查看>>
New Concept English three (35)
查看>>
NEW DATE()之参数传递
查看>>
New Journey--工作五年所思所感小记
查看>>