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

你可能感兴趣的文章
pandas.columns、get_dummies等用法
查看>>
pandas.DataFrame.copy(deep=True) 实际上并不创建深拷贝
查看>>
pandas.read_csv()的详解-ChatGPT4o作答
查看>>
PANDAS.READ_EXCEL()输出‘;溢出错误:日期值超出范围‘;而不存在日期列
查看>>
pandas100个骚操作:再见 for 循环!速度提升315倍!
查看>>
Pandas:如何根据其他列值的条件对列进行求和?
查看>>
Pandas:对给定列求和 DataFrame 行
查看>>
Pandas、Matplotlib、Pyecharts数据分析实践
查看>>
Pandas中文官档 ~ 基础用法1
查看>>
Pandas中文官档~基础用法2
查看>>
Pandas中文官档~基础用法5
查看>>
Pandas中文官档~基础用法6
查看>>
Pandas中的GROUP BY AND SUM不丢失列
查看>>
Pandas之iloc、loc
查看>>
pandas交换两列
查看>>
pandas介绍-ChatGPT4o作答
查看>>
pandas去除Nan值
查看>>
pandas实战:电商平台用户分析
查看>>
Pandas库函数
查看>>
Pandas库常用方法、函数集合
查看>>