博客
关于我
Elasticsearch 索引字段类型为text,添加keyword类型操作
阅读量:802 次
发布时间: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/

你可能感兴趣的文章
spring缓存注解@Cacheable、@CacheEvict、@CachePut使用
查看>>
P1865 A % B Problem
查看>>
P1908 逆序对
查看>>
P2158 [SDOI2008]仪仗队
查看>>
P2161 [SHOI2009]Booking 会场预约
查看>>
P2260 [清华集训2012]模积和
查看>>
P3203 [HNOI2010]弹飞绵羊 —— 懒标记?分块?
查看>>
P3240 [HNOI2015]实验比较 树形DP
查看>>
P3383 素数筛
查看>>
P3455 [POI2007]ZAP-Queries
查看>>
P3950部落冲突
查看>>
P4 Tutorials Flowlet Switching
查看>>
P4313 文理分科
查看>>
P4491 [HAOI2018] 染色
查看>>
SpringBoot中集成LiteFlow(轻量、快速、稳定可编排的组件式规则引擎)实现复杂业务解耦、动态编排、高可扩展
查看>>
P5-js python中的map()函数
查看>>
SpringBoot中集成influxdb-java实现连接并操作Windows上安装配置的influxDB(时序数据库)
查看>>
P8738 [蓝桥杯 2020 国 C] 天干地支
查看>>
PA
查看>>
Package Header Cursor
查看>>