elasticsearch - Is mapping property names with dot is allowed in Elasticsearch Index Management?
问题描述
For example, a JSON file with key-value pair where the key name has a dot in between it. When this file is uploaded, the dot is treated as next line \n and the name will split into two properties. I tried to use mapper.allow_dots_in_name=True in the setting but no effect.
Similar question posted by someone else, but no reply https://discuss.elastic.co/t/disable-expansion-of-field-names-with-dots-in-mapping/84761
Appreciate if anyone could help.
解决方案
Elasticsearch 2.4 includes a property where the field names can include a dot. And the field will not get converted to object style mapping.
This setting can be enabled by
export ES_JAVA_OPTS="-Dmapper.allow_dots_in_name=true"
But from 5.x, it is not possible to get a field value with dots without converting it into object mapping. If you index a field like abc.foo.bar
(with no explicit mapping). This will get converted to
{
"mappings": {
"properties": {
"abc": {
"properties": {
"foo": {
"properties": {
"bar": {
"type": "long"
}
}
}
}
}
}
}
}
It is best to avoid dots in the field names. You can refer to this documentation, to know more about this
推荐阅读
- javascript - 2 个具有最小和最大日期的依赖日期选择器
- c# - 从 EF 中的集合中删除项目 - 奇怪的问题
- r - 在 CentOS 的 fftwtools 上安装 R 包需要 fftw3
- android - 从 Webview 调用时,Admob 插页式广告不可点击
- yii2 - Yii2 GridView如何使用GET参数创建链接到数组ModelSearch
- c# - 如何使用 Application Insights Profiler 分析对 Azure 云服务的所有 Web 请求?
- bash - 如何以另一个用户身份从脚本运行函数
- node.js - 无法将环境变量传递给 docker
- r - 如何在不丢失行的情况下加入数据框
- ios - Siri 快捷方式:从包含的应用程序调用 API