- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我遇到了一个与 elasticsearch 相关的问题 geo_point 从数据库导入时。
如果 的值,我的映射效果很好龙 或 纬度 字段包含实际值。
现在可能发生某些行包含 空值 为 经纬度如果我尝试导入这些,我会得到一个 ElasticsearchParseException[纬度必须是数字] 错误似乎完全合法。
所以我想将这些字段设置为 0,0 或 NULL,NULL 但这是我卡住的地方。
我尝试添加 'null_value' => '0' 到映射,但这似乎不起作用。
这是映射的样子:
'_source' => array(
'enabled' => true
),
'properties' => array(
'coordinates' => array(
'type' => 'geo_point',
'null_value' => '0'
)
)
最佳答案
FWIW 这是您的文档结构的问题,而不是空值的存在。
如果您有一个字段 coordinates
具有映射类型 geo_point
,您必须使用 {..., coordinates: null}
插入您的文档而不是 {..., coordinates: {lat: null, lon: null}}
或类似 equivalent formats .必须缺少整个字段,而不是其内部数据。
关于geo_point 与 null_value 的 Elasticsearch 映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23756384/
是否可以将对象用于 null_value在 ElasticSearch 中映射? { "properties-v3": { "mappings": { "prope
我正在尝试为“文本”字段定义“null_value”(版本 5.1.1)。像这样: PUT students { "mappings": { "student": { "pro
我遇到了一个与 elasticsearch 相关的问题 geo_point 从数据库导入时。 如果 的值,我的映射效果很好龙 或 纬度 字段包含实际值。 现在可能发生某些行包含 空值 为 经纬度如果我
我是一名优秀的程序员,十分优秀!