Skip to content

Commit e34675d

Browse files
author
Luca Favatella
committed
Index RPT geospatial fields following upstream
`RPT` appears to be an improvement over `LatLonType` and is [in Solr >= 4.0.0][1]. [1]: https://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.3.0/solr/CHANGES.txt#L8649 Schema excerpts are mostly taken from Solr 6.3.0: * https://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.3.0/solr/server/solr/configsets/basic_configs/conf/managed-schema#L157 * https://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.3.0/solr/server/solr/configsets/basic_configs/conf/managed-schema#L557-L562 The schema excerpts from Solr 6.3.0 are adapted in order to work with the Solr versions integrated with Riak 2.2.0 and 2.0.7 i.e. respectively Solr 4.10.4 and 4.7.0. The only change regards the distance unit. Distance unit ==== Attribute name ---- In order to support Solr 4.10.4 and 4.7.0, prefer (now [deprecated][2]) attribute `units` over `distanceUnits` introduced in Solr 6. [2]: apache/lucene-solr@8fd247c Degrees vs. kilometers ---- Specify unit `degrees` rather than `kilometers` because that is the only one supported in Solr 4.10.4 and 4.7.0. Consequently adapt attribute `maxDistErr`: `maxDistErr="0.001" distanceUnits="kilometers"` can be written roughly as `maxDistErr="0.000009" units="degrees"`. * From [Solr 4.7.0 reference guide][3] (BTW this excerpt is the same in Solr 4.10.4 ref guide): > Defines the highest level of detail required for indexed data. If > left blank, the default is one meter – just a bit less than > 0.000009 degrees. This setting is used internally to compute an > appropriate maxLevels (see below). [3]: https://archive.apache.org/dist/lucene/solr/ref-guide/apache-solr-ref-guide-4.7.pdf * The relevant source code is the following (I did not verify that `0.000009` is the result of that expression): * https://github.com/apache/lucene-solr/blob/releases/lucene-solr/4.7.0/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java#L86 * https://github.com/apache/lucene-solr/blob/releases/lucene-solr/4.10.4/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeFactory.java#L86
1 parent 5dc0f26 commit e34675d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

priv/default_schema.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<dynamicField name="*_dts" type="date" indexed="true" stored="true" multiValued="true"/>
8383
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" multiValued="false"/>
8484
<dynamicField name="*_p" type="location" indexed="true" stored="true" multiValued="false"/>
85+
<dynamicField name="*_srpt" type="location_rpt" indexed="true" stored="true" multiValued="false"/>
8586

8687
<!-- some trie-coded dynamic fields for faster range queries -->
8788
<dynamicField name="*_ti" type="tint" indexed="true" stored="true" multiValued="false"/>
@@ -407,6 +408,17 @@
407408
-->
408409
<fieldtype name="geohash" class="solr.GeoHashField"/>
409410

411+
<!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
412+
For more information about this and other Spatial fields new to Solr 4, see:
413+
http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
414+
-->
415+
<!-- `maxDistErr` of one meter (0.001 kilometers) is just a bit less than 0.000009 degrees.
416+
For more information about this, see:
417+
https://archive.apache.org/dist/lucene/solr/ref-guide/apache-solr-ref-guide-4.7.pdf
418+
-->
419+
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
420+
geo="true" distErrPct="0.025" maxDistErr="0.000009" units="degrees" />
421+
410422
<!-- some examples for different languages (generally ordered by ISO code) -->
411423

412424
<!-- Arabic -->

0 commit comments

Comments
 (0)