11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

See the section SpatialRecursivePrefixTreeFieldType below for RPT configuration specifics.<br />

Spatial Filters<br />

There are 2 types of Spatial filters, which both support the following parameters:<br />

Parameter<br />

d<br />

pt<br />

sfield<br />

score<br />

Description<br />

the radial distance, usually in kilometers. (RPT & BBoxField can set other units via the setting di<br />

stanceUnits)<br />

the center point using the format "lat,lon" if latitude & longitude. Otherwise, "x,y" for PointType or<br />

"x y" for RPT field types.<br />

a spatial indexed field<br />

(Advanced option; RPT and BBoxField field types only) If the query is used in a scoring context<br />

(e.g. as the main query in q), this local-param determines what scores will be produced. Valid<br />

values are:<br />

none - A fixed score of 1.0. (the default)<br />

kilometers - distance in kilometers between the field value and the specified center point<br />

miles - distance in miles between the field value and the specified center point<br />

degrees - distance in degrees between the field value and the specified center point<br />

distance - distance between the field value and the specified center point in the distance<br />

Units configured for this field<br />

recipDistance - 1 / the distance<br />

WARNING: Don't use this for indexed non-point shapes (e.g. polygons). The results will be<br />

erroneous. And with RPT, it's only recommended for multi-valued point data, as the<br />

implementation doesn't scale very well and for single-valued fields, you should instead use a<br />

separate LatLonType field purely for distance sorting.<br />

When used with<br />

BBoxField,additional options are supported:<br />

overlapRatio - The relative overlap between the indexed shape & query shape.<br />

area - haversine based area of the overlapping shapes expressed in terms of the distance<br />

Units configured for this field<br />

area2D - cartesian coordinates based area of the overlapping shapes expressed in terms of<br />

the distanceUnits configured for this field<br />

filter<br />

(Advanced option; RPT and BBoxField field types only) If you only want the query to score (with<br />

the above score local-param), not filter, then set this local-param to false.<br />

geofilt<br />

The geofilt filter allows you to retrieve results based on the geospatial distance (AKA the "great circle<br />

distance") from a given point. Another way of looking at it is that it creates a circular shape filter. For example, to<br />

find all documents within five kilometers of a given lat/lon point, you could enter &q=*:*&fq={!geofilt<br />

sfield=store}&pt=45.15,-93.85&d=5. This filter returns all results within a circle of the given radius<br />

around the initial point:<br />

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

371

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

Saved successfully!

Ooh no, something went wrong!