public class TwoDoublesStrategy extends SpatialStrategy
| Modifier and Type | Field and Description |
|---|---|
int |
precisionStep |
static String |
SUFFIX_X |
static String |
SUFFIX_Y |
ctx, ignoreIncompatibleGeometry| Constructor and Description |
|---|
TwoDoublesStrategy(com.spatial4j.core.context.SpatialContext ctx,
String fieldNamePrefix) |
| Modifier and Type | Method and Description |
|---|---|
IndexableField[] |
createIndexableFields(com.spatial4j.core.shape.Shape shape)
Returns the IndexableField(s) from the
shape that are to be
added to the Document. |
Filter |
makeFilter(SpatialArgs args)
Make a Filter
|
Query |
makeQuery(SpatialArgs args)
Make a query which has a score based on the distance from the data to the query shape.
|
ValueSource |
makeValueSource(SpatialArgs args)
The value source yields a number that is proportional to the distance between the query shape and indexed data.
|
void |
setPrecisionStep(int p) |
getFieldName, getSpatialContext, isIgnoreIncompatibleGeometry, setIgnoreIncompatibleGeometry, toStringpublic static final String SUFFIX_X
public static final String SUFFIX_Y
public int precisionStep
public TwoDoublesStrategy(com.spatial4j.core.context.SpatialContext ctx,
String fieldNamePrefix)
public void setPrecisionStep(int p)
public IndexableField[] createIndexableFields(com.spatial4j.core.shape.Shape shape)
SpatialStrategyshape 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.
createIndexableFields in class SpatialStrategypublic ValueSource makeValueSource(SpatialArgs args)
SpatialStrategymakeValueSource in class SpatialStrategypublic Filter makeFilter(SpatialArgs args)
SpatialStrategymakeFilter in class SpatialStrategypublic Query makeQuery(SpatialArgs args)
SpatialStrategyFilteredQuery based on
SpatialStrategy.makeFilter(org.apache.lucene.spatial.query.SpatialArgs) and
SpatialStrategy.makeValueSource(org.apache.lucene.spatial.query.SpatialArgs).makeQuery in class SpatialStrategyCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.