gpt4 book ai didi

Solr 的地理空间格式器不起作用?

转载 作者:行者123 更新时间:2023-12-04 15:41:36 27 4
gpt4 key购买 nike

我已经索引了一个包含 SpatialRecursivePrefixTreeFieldType 的文档名为“地理”的字段。我正在阅读 Geospatial formatter并想尝试一下,但我似乎无法让它发挥作用。

这是我编入索引的示例文档:

{
"geo": "POLYGON((22.376144 -50.055954, 36.013237 -50.055954, 36.013237 -47.949005, 22.376144 -47.949005, 22.376144 -50.055954))",
"id": "a3ca6c69-acb9-30e6-b1a6-dbfd72917bc8",
"val_d": 33.067356,
"_version_": 1541776337602084900,
"insert_timestamp": "2016-08-04T23:14:54.814Z"
}

这是我正在尝试的查询:
q=id%3A%22a3ca6c69-acb9-30e6-b1a6-dbfd72917bc8%22&rows=1&fl=*%2C%5Bgeo+f%3Dgeo+w%3DGeoJSON%5D&wt=json&indent=true

以更易读的格式:
q=id:"a3ca6c69-acb9-30e6-b1a6-dbfd72917bc8"
rows=1
fl=*,[geo f=geo w=GeoJSON]
wt=json
indent=true

我得到的结果只是我上面引用的索引文档。我也尝试修改 fl参数包含这样的键 fl=*,geojson[geo f=geo w=GeoJSON]但这也不起作用。

有什么原因我不能让格式化程序工作吗?

版本信息:
  • solr 规范:5.3.1
  • solr-impl:5.3.1 1703449 - 贵族 - 2015-09-17 01:48:15
  • lucene 规范:5.3.1
  • lucene-impl:5.3.1 1703449 - 贵族 - 2015-09-17 01:38:09
  • 最佳答案

    地理空间转换器是在 6.1 版中根据以下内容添加的:

    https://issues.apache.org/jira/browse/SOLR-8814

    With minor changes, we can modify the existing JSON writer to produce a GeoJSON FeatureCollection for ever SolrDocumentList. We can then pick a field to use as the geometry type, and use that for the Feature#geometry
    "response":{"type":"FeatureCollection","numFound":1,"start":0,"features":[
    {"type":"Feature",
    "geometry":{"type":"Point","coordinates":[1,2]},
    "properties":{
    ... the normal solr doc fields here ...}}]
    }}

    This will allow adding solr results directly to various mapping clients like Leaflet This patch will work with Documents that have a spatial field the either: 1. Extends AbstractSpatialFieldType 2. has a stored value with geojson 2. has a stored value that can be parsed by spatial4j (WKT, etc) The spatial field is identified with the parameter geojson.field



    它被标记为

    Fix Version/s: 6.1, master (7.0)



    所以这个问题的答案是;地理空间格式化程序需要升级到 Solr 6.1 才能工作。

    关于Solr 的地理空间格式器不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39254495/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com