ArcGIS Server Geoportal extension
10

com.esri.gpt.catalog.lucene
Class SpatialQuery

java.lang.Object
  extended by org.apache.lucene.search.Query
      extended by com.esri.gpt.catalog.lucene.SpatialQuery
All Implemented Interfaces:
Serializable, Cloneable

public class SpatialQuery
extends Query

An implementation of the Lucene Query model to support spatial queries.

There are two inner and private classes: SpatialWeight and SpatialScorer. Together, these three classes provide the interface for the execution of queries within the Lucene model.

Very little work is done within this class (and it's two inner classes). It simply provides the interface end-points for query execution.

The majority of work (both spatial filtering and spatial relevance scoring) is performed by the SpatialFilter class.

See Also:
Serialized Form

Constructor Summary
SpatialQuery(SpatialFilter filter)
          Constructor.
 
Method Summary
 Weight createWeight(Searcher searcher)
          Creates a weight for the query.
 Query rewrite(IndexReader reader)
          Called to re-write queries into primitive queries.
 String toString(String field)
          Returns a string representation of the query.
 
Methods inherited from class org.apache.lucene.search.Query
clone, combine, equals, extractTerms, getBoost, getSimilarity, hashCode, mergeBooleanQueries, setBoost, toString, weight
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpatialQuery

public SpatialQuery(SpatialFilter filter)
Constructor.

Parameters:
filter - the spatial filter
Method Detail

createWeight

public Weight createWeight(Searcher searcher)
                    throws IOException
Creates a weight for the query.

Overrides:
createWeight in class Query
Parameters:
searcher - the index searcher
Returns:
the new Weight
Throws:
IOException - if an exception occurs while accessing the index

rewrite

public Query rewrite(IndexReader reader)
              throws IOException
Called to re-write queries into primitive queries.

Overrides:
rewrite in class Query
Parameters:
reader - the index reader
Returns:
the Query
Throws:
IOException - if an exception occurs while accessing the index

toString

public String toString(String field)
Returns a string representation of the query.

Specified by:
toString in class Query
Parameters:
field - the associated field name
Returns:
the string

ArcGIS Server Geoportal extension
10

Copyright 2010 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.