public abstract class PrefixTreeStrategy extends SpatialStrategy
| Modifier and Type | Field and Description |
|---|---|
protected int |
defaultFieldValuesArrayLen |
protected double |
distErrPct |
static FieldType |
FIELD_TYPE |
protected SpatialPrefixTree |
grid |
ctx, ignoreIncompatibleGeometry| Constructor and Description |
|---|
PrefixTreeStrategy(SpatialPrefixTree grid,
String fieldName) |
| 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. |
SpatialPrefixTree |
getGrid() |
ValueSource |
makeValueSource(SpatialArgs args)
The value source yields a number that is proportional to the distance between the query shape and indexed data.
|
ValueSource |
makeValueSource(SpatialArgs args,
com.spatial4j.core.distance.DistanceCalculator calc) |
void |
setDefaultFieldValuesArrayLen(int defaultFieldValuesArrayLen)
Used in the in-memory ValueSource as a default ArrayList length for this field's array of values, per doc.
|
void |
setDistErrPct(double distErrPct)
|
getFieldName, getSpatialContext, isIgnoreIncompatibleGeometry, makeFilter, makeQuery, setIgnoreIncompatibleGeometry, toStringprotected final SpatialPrefixTree grid
protected int defaultFieldValuesArrayLen
protected double distErrPct
public static final FieldType FIELD_TYPE
public PrefixTreeStrategy(SpatialPrefixTree grid, String fieldName)
public void setDefaultFieldValuesArrayLen(int defaultFieldValuesArrayLen)
public void setDistErrPct(double distErrPct)
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 ValueSource makeValueSource(SpatialArgs args, com.spatial4j.core.distance.DistanceCalculator calc)
public SpatialPrefixTree getGrid()
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.