java - how to index each feature elasticsearch featurecollection
问题描述
I got a typical FeatureCollection json file, when I import this file via Kibana I can see that the index has docs count equivalent to a number of features in FeatureCollection, so I can do a query and get the specific feature. But when I try to index this file via java and using mapping like this, I can save the file but with docs count = 1, so I can't do geospatial query to get a specific feature.
{
"mappings": {
"dynamic": true,
"properties": {
"checksum": {
"type": "keyword"
},
"geometry": {
"properties": {
"coordinates": {
"type": "geo_shape"
}
}
}
}
}
}
this is the file:
{
"hashCode": 1708148999,
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "station_exits.fid--3e26eb90_1774de53429_-64b5",
"geometry": {
"type": "Point",
"coordinates": [38.5752041, 54.8366001, 75.25849601491346]
},
"properties": {
"gid": 1,
"obj_id": "004528ca-3b1f-4210-b10e-afab2d268144",
"prefect": "SAO",
"district": "Timit",
"obj_name": "exits",
"line": "xxxxx",
"status": "xxxx",
"link": "/view/main"
}
}
]
}
Can anyone help to make the right mapping?
解决方案
推荐阅读
- linux - 将 unix 域套接字的所有权从一个进程转移到另一个进程
- c - 将代码从二进制文件复制到新文件中:新文件未执行代码
- python - python内核与vscode的连接
- angular - 如何在 Angular 中制作动态过滤器管道(组合标准)?
- scala - 在不带引号的情况下从正在解析的文件中转义或删除新行
- reactjs - 打字稿:如何按键索引嵌套对象?
- python - 如何使用 seaborn 为分类数据绘制堆积 100% 条形图
- javascript - JS 类属性使用构造函数/设置 get 方法返回未定义
- github - 为什么 Visual Studio 2019 中不提供 Commit All 和 Push 命令?
- php - 执行 php 块而不保存到文件,不更改内部路径