SOLR 4.2 - solr.LatLonType类型vs solr.SpatialRecursivePrefixTreeFieldType

Lea*_*ner 5 lucene solr geospatial spatial-index solr4

我目前正在使用SOLR 4.2来索引地理空间数据(纬度和经度数据).我已将我的地理空间字段配置如下.

 <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>   

  <field name="latlong"     type="location"   indexed="true" stored="false" multiValued="true"/>
Run Code Online (Sandbox Code Playgroud)

我只是想确保我使用正确的SOLR类来执行地理空间搜索,因为我不确定未来版本的SOLR将支持哪个2类(LatLonType与SpatialRecursivePrefixTreeFieldType).

我假设SpatialRecursivePrefixTreeFieldType是latlong的升级版本,有人可以确认我是否正确吗?

Dav*_*ley 5

我一般推荐SpatialRecursivePrefixTreeFieldType. 它在很多方面都更好,但我不会称其为“升级版LatLonType”,因为这种措辞表明它是完全错误的衍生品。它在这里记录: http: //wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4LatLonType使用(可能与新字段类型结合使用)的 主要原因是距离排序/相关性,这可以通过LatLonTypestill 更好地实现(从 Solr 4.3 开始) 。

我不认为LatLonType很快就会消失;Solr 非常重视向后兼容性。