Package org.apache.lucene.document
Class ShapeDocValuesField
- java.lang.Object
-
- org.apache.lucene.document.Field
-
- org.apache.lucene.document.ShapeDocValuesField
-
- All Implemented Interfaces:
IndexableField
- Direct Known Subclasses:
LatLonShapeDocValuesField
,XYShapeDocValuesField
public abstract class ShapeDocValuesField extends Field
A doc values field forLatLonShape
andXYShape
that usesShapeDocValues
as the underlying binary doc value format.Note that this class cannot be instantiated directly due to different encodings
XYEncodingUtils
andGeoEncodingUtils
Concrete Implementations include:
LatLonShapeDocValuesField
andXYShapeDocValuesField
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.document.Field
Field.Store
-
-
Field Summary
Fields Modifier and Type Field Description protected static FieldType
FIELD_TYPE
FieldType for ShapeDocValues fieldprotected org.apache.lucene.document.ShapeDocValues
shapeDocValues
the binary doc value format for this field-
Fields inherited from class org.apache.lucene.document.Field
fieldsData, name, tokenStream, type
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract double
decodeX(int encoded)
decodes x coordinates from encoded spaceprotected abstract double
decodeY(int encoded)
decodes y coordinates from encoded spaceIndexableFieldType
fieldType()
Gets theIndexableFieldType
for this ShapeDocValue fieldabstract Geometry
getBoundingBox()
retrieves the bounding box for the geometryabstract Geometry
getCentroid()
retrieves the centroid location for the geometryShapeField.DecodedTriangle.TYPE
getHighestDimensionType()
Retrieves the highest dimensional type (POINT, LINE, TRIANGLE) for computing the geometry(s) centroidString
name()
The name of the fieldstatic Query
newGeometryQuery(String field, ShapeField.QueryRelation relation, Object... geometries)
Creates a geometry query for shape docvaluesint
numberOfTerms()
Returns the number of terms (tessellated triangles) for this shapeString
stringValue()
Currently there is no string representation for the ShapeDocValueFieldTokenStream
tokenStream(Analyzer analyzer, TokenStream reuse)
TokenStreams are not yet supported-
Methods inherited from class org.apache.lucene.document.Field
binaryValue, getCharSequenceValue, invertableType, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, storedValue, tokenStreamValue, toString
-
-
-
-
Field Detail
-
shapeDocValues
protected final org.apache.lucene.document.ShapeDocValues shapeDocValues
the binary doc value format for this field
-
FIELD_TYPE
protected static final FieldType FIELD_TYPE
FieldType for ShapeDocValues field
-
-
Method Detail
-
name
public String name()
The name of the field- Specified by:
name
in interfaceIndexableField
- Overrides:
name
in classField
-
fieldType
public IndexableFieldType fieldType()
Gets theIndexableFieldType
for this ShapeDocValue field- Specified by:
fieldType
in interfaceIndexableField
- Overrides:
fieldType
in classField
-
stringValue
public String stringValue()
Currently there is no string representation for the ShapeDocValueField- Specified by:
stringValue
in interfaceIndexableField
- Overrides:
stringValue
in classField
-
tokenStream
public TokenStream tokenStream(Analyzer analyzer, TokenStream reuse)
TokenStreams are not yet supported- Specified by:
tokenStream
in interfaceIndexableField
- Overrides:
tokenStream
in classField
- Parameters:
analyzer
- Analyzer that should be used to create the TokenStreams fromreuse
- TokenStream for a previous instance of this field name. This allows custom field types (like StringField and NumericField) that do not use the analyzer to still have good performance. Note: the passed-in type may be inappropriate, for example if you mix up different types of Fields for the same field name. So it's the responsibility of the implementation to check.- Returns:
- TokenStream value for indexing the document. Should always return a non-null value if the field is to be indexed
-
numberOfTerms
public int numberOfTerms()
Returns the number of terms (tessellated triangles) for this shape
-
newGeometryQuery
public static Query newGeometryQuery(String field, ShapeField.QueryRelation relation, Object... geometries)
Creates a geometry query for shape docvalues
-
getCentroid
public abstract Geometry getCentroid()
retrieves the centroid location for the geometry
-
getBoundingBox
public abstract Geometry getBoundingBox()
retrieves the bounding box for the geometry
-
getHighestDimensionType
public ShapeField.DecodedTriangle.TYPE getHighestDimensionType()
Retrieves the highest dimensional type (POINT, LINE, TRIANGLE) for computing the geometry(s) centroid
-
decodeX
protected abstract double decodeX(int encoded)
decodes x coordinates from encoded space
-
decodeY
protected abstract double decodeY(int encoded)
decodes y coordinates from encoded space
-
-