org.elasticsearch.common.lucene.spatial.prefix
Class TermQueryPrefixTreeStrategy

java.lang.Object
  extended by org.elasticsearch.common.lucene.spatial.SpatialStrategy
      extended by org.elasticsearch.common.lucene.spatial.prefix.TermQueryPrefixTreeStrategy

public class TermQueryPrefixTreeStrategy
extends SpatialStrategy

Implementation of SpatialStrategy that uses TermQuerys / TermFilters to query and filter for Shapes related to other Shapes.


Constructor Summary
TermQueryPrefixTreeStrategy(FieldMapper.Names fieldName, SpatialPrefixTree prefixTree, double distanceErrorPct)
          Creates a new TermQueryPrefixTreeStrategy
 
Method Summary
 org.apache.lucene.search.Filter createContainsFilter(com.spatial4j.core.shape.Shape shape)
          Creates a Filter that will find all indexed Shapes that are properly contained within the given Shape (the indexed Shapes will not have any area outside of the given Shape).
 org.apache.lucene.search.Query createContainsQuery(com.spatial4j.core.shape.Shape shape)
          Creates a Query that will find all indexed Shapes that are properly contained within the given Shape (the indexed Shapes will not have any area outside of the given Shape).
 org.apache.lucene.search.Filter createDisjointFilter(com.spatial4j.core.shape.Shape shape)
          Creates a Filter that will find all indexed Shapes that are disjoint to the given Shape
 org.apache.lucene.search.Query createDisjointQuery(com.spatial4j.core.shape.Shape shape)
          Creates a Query that will find all indexed Shapes that are disjoint to the given Shape
 org.apache.lucene.search.Filter createIntersectsFilter(com.spatial4j.core.shape.Shape shape)
          Creates a Filter that will find all indexed Shapes that intersect with the given Shape
 org.apache.lucene.search.Query createIntersectsQuery(com.spatial4j.core.shape.Shape shape)
          Creates a Query that will find all indexed Shapes that intersect with the given Shape
 
Methods inherited from class org.elasticsearch.common.lucene.spatial.SpatialStrategy
createField, createFilter, createQuery, getDistanceErrorPct, getFieldName, getPrefixTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermQueryPrefixTreeStrategy

public TermQueryPrefixTreeStrategy(FieldMapper.Names fieldName,
                                   SpatialPrefixTree prefixTree,
                                   double distanceErrorPct)
Creates a new TermQueryPrefixTreeStrategy

Parameters:
fieldName - Name of the field the Strategy applies to
prefixTree - SpatialPrefixTree that will be used to represent Shapes
distanceErrorPct - Distance Error Percentage used to guide the SpatialPrefixTree on how precise it should be
Method Detail

createIntersectsFilter

public org.apache.lucene.search.Filter createIntersectsFilter(com.spatial4j.core.shape.Shape shape)
Creates a Filter that will find all indexed Shapes that intersect with the given Shape

Specified by:
createIntersectsFilter in class SpatialStrategy
Parameters:
shape - Shape to find the intersection Shapes of
Returns:
Filter finding the intersecting indexed Shapes

createIntersectsQuery

public org.apache.lucene.search.Query createIntersectsQuery(com.spatial4j.core.shape.Shape shape)
Creates a Query that will find all indexed Shapes that intersect with the given Shape

Specified by:
createIntersectsQuery in class SpatialStrategy
Parameters:
shape - Shape to find the intersection Shapes of
Returns:
Query finding the intersecting indexed Shapes

createDisjointFilter

public org.apache.lucene.search.Filter createDisjointFilter(com.spatial4j.core.shape.Shape shape)
Creates a Filter that will find all indexed Shapes that are disjoint to the given Shape

Specified by:
createDisjointFilter in class SpatialStrategy
Parameters:
shape - Shape to find the disjoint Shapes of
Returns:
Filter for finding the disjoint indexed Shapes

createDisjointQuery

public org.apache.lucene.search.Query createDisjointQuery(com.spatial4j.core.shape.Shape shape)
Creates a Query that will find all indexed Shapes that are disjoint to the given Shape

Specified by:
createDisjointQuery in class SpatialStrategy
Parameters:
shape - Shape to find the disjoint Shapes of
Returns:
Query for finding the disjoint indexed Shapes

createContainsFilter

public org.apache.lucene.search.Filter createContainsFilter(com.spatial4j.core.shape.Shape shape)
Creates a Filter that will find all indexed Shapes that are properly contained within the given Shape (the indexed Shapes will not have any area outside of the given Shape).

Specified by:
createContainsFilter in class SpatialStrategy
Parameters:
shape - Shape to find the contained Shapes of
Returns:
Filter for finding the contained indexed Shapes

createContainsQuery

public org.apache.lucene.search.Query createContainsQuery(com.spatial4j.core.shape.Shape shape)
Creates a Query that will find all indexed Shapes that are properly contained within the given Shape (the indexed Shapes will not have any area outside of the given Shape).

Specified by:
createContainsQuery in class SpatialStrategy
Parameters:
shape - Shape to find the contained Shapes of
Returns:
Query for finding the contained indexed Shapes


Copyright © 2009-2012. All Rights Reserved.