I am currently using SOLR 4.2 to index geospatial data (latitude and longitude data). I have configured my geospatial field as below.
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
<field name="latlong" type="location" indexed="true" stored="false" multiValued="true"/>
I just want to make sure that I am using the correct SOLR class for performing geospatial search since I am not sure which of the 2 class(LatLonType vs SpatialRecursivePrefixTreeFieldType) will be supported by future versions of SOLR.
I assume SpatialRecursivePrefixTreeFieldType is an upgraded version of latlong, can someone please confirm if I am right?
I generally recommend the SpatialRecursivePrefixTreeFieldType
. It's better in many ways, but I wouldn't call it an "upgraded version of LatLonType
" since that wording suggests it is a derivative which totally false. It's documented here: http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4 The main reason to use LatLonType
(perhaps in conjunction with the new field type) is for distance sorting/relevancy which is better implemented by LatLonType
still (as of Solr 4.3).
I don't see LatLonType
going away any time soon; Solr takes backwards compatibility pretty seriously.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With