11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

maxDistErr<br />

worldBounds<br />

Defines the highest level of detail required for indexed data. If left blank, the default is<br />

one meter – just a bit less than 0.000009 degrees. This setting is used internally to<br />

compute an appropriate maxLevels (see below).<br />

Defines the valid numerical ranges for x and y, in the format of ENVELOPE(minX,<br />

maxX, maxY, minY) . If geo="true" , the standard lat-lon world boundaries are<br />

assumed. If geo=false, you should define your boundaries.<br />

distCalculator Defines the distance calculation algorithm. If geo=true, "haversine" is the default. If<br />

geo=false, "cartesian" will be the default. Other possible values are "lawOfCosines",<br />

"vincentySphere" and "cartesian^2".<br />

prefixTree<br />

maxLevels<br />

Defines the spatial grid implementation. Since a PrefixTree (such as<br />

RecursivePrefixTree) maps the world as a grid, each grid cell is decomposed to<br />

another set of grid cells at the next level. If geo=true then the default prefix tree is " g<br />

eohash", otherwise it's " quad". Geohash has 32 children at each level, quad has 4.<br />

Geohash can only be used for geo=true as it's strictly geospatial. A third choice is " p<br />

ackedQuad", which is generally more efficient than plain "quad", provided there are<br />

many levels -- perhaps 20 or more.<br />

Sets the maximum grid depth for indexed data. Instead, it's usually more intuitive to<br />

compute an appropriate maxLevels by specifying maxDistErr .<br />

And there are others: normWrapLongitude, datelineRule, validationRule, autoIndex,<br />

allowMulti<br />

Overlap, precisionModel. For further info, see the note about spatialContextFactory implementations<br />

referenced above, especially the link to the JTS based one.<br />

<br />

Once the field type has been defined, define a field that uses it.<br />

Beyond this reference guide, there are some details that remain at the <strong>Solr</strong> Wiki at http://wiki.apache.org/s<br />

olr/<strong>Solr</strong>AdaptersForLuceneSpatial4<br />

RptWithGeometrySpatialField<br />

The RptWithGeometrySpatialField field type is a derivative of SpatialRecursivePrefixTreeFieldT<br />

ype that also stores the original geometry in Lucene DocValues, which it uses to achieve accurate search. It can<br />

also be used for indexed point fields. The Intersects predicate (the default) is particularly fast, since many<br />

search results can be returned as an accurate hit without requiring a geometry check. This field type is<br />

configured just like RPT is.<br />

An optional in-memory cache can be defined in solrconfig.xml, which should be done when the data tends to<br />

have shapes with many vertices. Assuming you name your field "geom", you can configure an optional<br />

cache in solrconfig.xml by adding the following – notice the suffix of the cache name:<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

375

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!