我找到了很多关于如何更改特定修订版本的用户名等的示例.
但我需要的是:我使用同事的身份验证凭据进行结账,并需要将其更改为我的凭据以供将来提交.
由于已经进行了许多更改,我不能只使用我的凭据结帐...
有人熟悉这个吗?
尝试构建搜索如下:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geo_distance": {
"distance": "50km",
"coordinates": {
"lat": 52.5234051,
"lon": 4.113999
}
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
其中坐标的类型为'geo_point'.
但是当我尝试运行此查询时,弹出的searchsearch.log会弹出一个错误:[locations]找不到geo_point字段[coordinates]
编辑:
这是/ locations/location/_mapping的一部分:
{
"locations": {
"mappings": {
"location": {
"properties": {
...
"coordinates": {
"properties": {
"lat": {
"type": "string"
},
"lon": {
"type": "string"
}
}
},
...
}
}
Run Code Online (Sandbox Code Playgroud)
任何想法在这里有什么不对?
我在从数据库导入时遇到了与elasticsearch的geo_point相关的问题。如果lon或lat字段的值包含实际值,我的映射效果很好。
现在,某些行可能包含经/纬度的空值,如果我尝试导入这些值,我会收到ElasticsearchParseException[纬度必须是数字]错误,该错误看起来完全合法。
所以我想将这些字段设置为0,0 或 NULL,NULL但这就是我陷入困境的地方。
我尝试将'null_value' => '0'添加到映射中,但这似乎不起作用。
映射如下所示:
'_source' => array(
'enabled' => true
),
'properties' => array(
'coordinates' => array(
'type' => 'geo_point',
'null_value' => '0'
)
)
Run Code Online (Sandbox Code Playgroud)
有人知道这一点吗?
(我正在使用 PHP Elasticsearch 客户端。)