org.apache.lucene.spatial.vector
Class TwoDoublesStrategy
java.lang.Object
org.apache.lucene.spatial.SpatialStrategy
org.apache.lucene.spatial.vector.TwoDoublesStrategy
public class TwoDoublesStrategy
- extends SpatialStrategy
- WARNING: This API is experimental and might change in incompatible ways in the next release.
SUFFIX_X
public static final String SUFFIX_X
- See Also:
- Constant Field Values
SUFFIX_Y
public static final String SUFFIX_Y
- See Also:
- Constant Field Values
precisionStep
public int precisionStep
TwoDoublesStrategy
public TwoDoublesStrategy(com.spatial4j.core.context.SpatialContext ctx,
String fieldNamePrefix)
setPrecisionStep
public void setPrecisionStep(int p)
createIndexableFields
public IndexableField[] createIndexableFields(com.spatial4j.core.shape.Shape shape)
- Description copied from class:
SpatialStrategy
- Returns the IndexableField(s) from the
shape
that are to be
added to the Document
. These fields
are expected to be marked as indexed and not stored.
Note: If you want to store the shape as a string for retrieval in
search results, you could add it like this:
document.add(new StoredField(fieldName,ctx.toString(shape)));
The particular string representation used doesn't matter to the Strategy
since it doesn't use it.
- Specified by:
createIndexableFields
in class SpatialStrategy
- Returns:
- Not null nor will it have null elements.
makeValueSource
public ValueSource makeValueSource(SpatialArgs args)
- Description copied from class:
SpatialStrategy
- The value source yields a number that is proportional to the distance between the query shape and indexed data.
- Specified by:
makeValueSource
in class SpatialStrategy
makeFilter
public Filter makeFilter(SpatialArgs args)
- Description copied from class:
SpatialStrategy
- Make a Filter
- Specified by:
makeFilter
in class SpatialStrategy
makeQuery
public Query makeQuery(SpatialArgs args)
- Description copied from class:
SpatialStrategy
- Make a query which has a score based on the distance from the data to the query shape.
The default implementation constructs a
FilteredQuery
based on
SpatialStrategy.makeFilter(org.apache.lucene.spatial.query.SpatialArgs)
and
SpatialStrategy.makeValueSource(org.apache.lucene.spatial.query.SpatialArgs)
.
- Overrides:
makeQuery
in class SpatialStrategy
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.