org.apache.solr.search
Class SpatialFilterQParserPlugin

java.lang.Object
  extended by org.apache.solr.search.QParserPlugin
      extended by org.apache.solr.search.SpatialFilterQParserPlugin
All Implemented Interfaces:
SolrInfoMBean, NamedListInitializedPlugin
Direct Known Subclasses:
SpatialBoxQParserPlugin

public class SpatialFilterQParserPlugin
extends QParserPlugin

Creates a spatial Filter based on the type of spatial point used.

The field must implement SpatialQueryable

All units are in Kilometers

Syntax:

{!geofilt sfield=<location_field> pt=<lat,lon> d=<distance>}

Parameters:

The distance measure used currently depends on the FieldType. LatLonType defaults to using haversine, PointType defaults to Euclidean (2-norm).

Examples:

fq={!geofilt sfield=store pt=10.312,-20.556 d=3.5}
fq={!geofilt sfield=store}&pt=10.312,-20&d=3.5
fq={!geofilt}&sfield=store&pt=10.312,-20&d=3.5

Note: The geofilt for LatLonType is capable of also producing scores equal to the computed distance from the point to the field, making it useful as a component of the main query or a boosting query.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean
SolrInfoMBean.Category
 
Field Summary
static String NAME
           
 
Fields inherited from class org.apache.solr.search.QParserPlugin
DEFAULT_QTYPE, standardPlugins
 
Constructor Summary
SpatialFilterQParserPlugin()
           
 
Method Summary
 QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req)
          return a QParser
 void init(NamedList args)
           
 
Methods inherited from class org.apache.solr.search.QParserPlugin
getCategory, getDescription, getDocs, getName, getSource, getStatistics, getVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static String NAME
Constructor Detail

SpatialFilterQParserPlugin

public SpatialFilterQParserPlugin()
Method Detail

createParser

public QParser createParser(String qstr,
                            SolrParams localParams,
                            SolrParams params,
                            SolrQueryRequest req)
Description copied from class: QParserPlugin
return a QParser

Specified by:
createParser in class QParserPlugin

init

public void init(NamedList args)


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.