【发布时间】:2014-10-03 19:45:50
【问题描述】:
我正在尝试在我的应用程序中设置 Solr 地理空间搜索。该模型是我有多个地址的客户,我想用每个地址地理编码标记该客户,然后在距中心点一定距离内搜索客户。
它适用于一个地理编码。这是迄今为止我在模式中为每个 solr 条目提供多个地理编码的内容:
在 Schema.xml 中
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="true"/>
...
<field name="latlng" type="location" indexed="true" stored="true" multiValued="true" />
这很好,虽然当我通过 SOLR 管理员查询文档时,我只能看到各个坐标字段的值,而不是位置的值。有什么办法可以解决这个问题吗?
但更大的问题是当我执行这个 SOLR 查询时:
http://localhost:8983/solr/aust/select?q=*:*&fq={!geofilt pt=-37.8064822,144.96090520000007 sfield=latlng d=15}&wt=json&indent=true
错误:
"can not use FieldCache on multivalued field: latlng_0_coordinate"
我认为这是由于尝试对多值属性执行过滤查询而引起的。
我从 solr 管理面板尝试了这个:
http://localhost:8983/solr/aust/select?q=*:*&wt=json&indent=true&spatial=true&pt=-27.516473,152.95089480000001&sfield=latlng&d=20
但它只返回所有文档...
所以我想知道是否有另一种方法来查询多值位置参数?
【问题讨论】:
标签: solr