public abstract class SpatialStrategy extends Object
FieldCache and
DocValues (ideal) or is it for the entire
index?
| Modifier and Type | Field and Description |
|---|---|
protected com.spatial4j.core.context.SpatialContext |
ctx |
protected boolean |
ignoreIncompatibleGeometry |
| Constructor and Description |
|---|
SpatialStrategy(com.spatial4j.core.context.SpatialContext ctx,
String fieldName)
Constructs the spatial strategy with its mandatory arguments.
|
| Modifier and Type | Method and Description |
|---|---|
abstract IndexableField[] |
createIndexableFields(com.spatial4j.core.shape.Shape shape)
Returns the IndexableField(s) from the
shape that are to be
added to the Document. |
String |
getFieldName()
The name of the field or the prefix of them if there are multiple
fields needed internally.
|
com.spatial4j.core.context.SpatialContext |
getSpatialContext() |
boolean |
isIgnoreIncompatibleGeometry() |
abstract 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.
|
abstract ValueSource |
makeValueSource(SpatialArgs args)
The value source yields a number that is proportional to the distance between the query shape and indexed data.
|
void |
setIgnoreIncompatibleGeometry(boolean ignoreIncompatibleGeometry) |
String |
toString() |
protected boolean ignoreIncompatibleGeometry
protected final com.spatial4j.core.context.SpatialContext ctx
public SpatialStrategy(com.spatial4j.core.context.SpatialContext ctx,
String fieldName)
public com.spatial4j.core.context.SpatialContext getSpatialContext()
public String getFieldName()
public abstract IndexableField[] createIndexableFields(com.spatial4j.core.shape.Shape shape)
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.
public abstract ValueSource makeValueSource(SpatialArgs args)
public Query makeQuery(SpatialArgs args)
FilteredQuery based on
makeFilter(org.apache.lucene.spatial.query.SpatialArgs) and
makeValueSource(org.apache.lucene.spatial.query.SpatialArgs).public abstract Filter makeFilter(SpatialArgs args)
public boolean isIgnoreIncompatibleGeometry()
public void setIgnoreIncompatibleGeometry(boolean ignoreIncompatibleGeometry)
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.