Package org.apache.solr.schema
Class LatLonPointSpatialField
- java.lang.Object
-
- org.apache.solr.schema.FieldProperties
-
- org.apache.solr.schema.FieldType
-
- org.apache.solr.schema.AbstractSpatialFieldType<LatLonPointSpatialField.LatLonPointSpatialStrategy>
-
- org.apache.solr.schema.LatLonPointSpatialField
-
- All Implemented Interfaces:
SchemaAware
,SpatialQueryable
public class LatLonPointSpatialField extends AbstractSpatialFieldType<LatLonPointSpatialField.LatLonPointSpatialStrategy> implements SchemaAware
A spatial implementation based on Lucene'sLatLonPoint
andLatLonDocValuesField
. The first is based on Lucene's "Points" API, which is a BKD Index. This field type is strictly limited to coordinates in lat/lon decimal degrees. The accuracy is about a centimeter (1.042cm).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LatLonPointSpatialField.LatLonPointSpatialStrategy
-
Nested classes/interfaces inherited from class org.apache.solr.schema.FieldType
FieldType.DefaultAnalyzer, FieldType.MultiValueSelector
-
-
Field Summary
-
Fields inherited from class org.apache.solr.schema.AbstractSpatialFieldType
argsParser, ctx, DISTANCE, distanceUnits, FILTER_PARAM, FORMAT, NONE, RECIP_DISTANCE, SCORE_PARAM, shapeReader, shapeWriter, supportedScoreModes
-
Fields inherited from class org.apache.solr.schema.FieldType
ANALYZER, args, AUTO_GENERATE_PHRASE_QUERIES, CHAR_FILTER, CHAR_FILTERS, CLASS_NAME, docValuesFormat, ENABLE_GRAPH_QUERIES, falseProperties, FILTER, FILTERS, INDEX, INDEX_ANALYZER, MULTI_TERM, MULTI_TERM_ANALYZER, POLY_FIELD_SEPARATOR, postingsFormat, properties, QUERY, QUERY_ANALYZER, similarity, SIMILARITY, similarityFactory, SYNONYM_QUERY_STYLE, TOKENIZER, trueProperties, TYPE, TYPE_NAME, typeName
-
Fields inherited from class org.apache.solr.schema.FieldProperties
BINARY, DOC_VALUES, INDEXED, LARGE_FIELD, MULTIVALUED, OMIT_NORMS, OMIT_POSITIONS, OMIT_TF_POSITIONS, REQUIRED, SORT_MISSING_FIRST, SORT_MISSING_LAST, STORE_OFFSETS, STORE_TERMOFFSETS, STORE_TERMPAYLOADS, STORE_TERMPOSITIONS, STORE_TERMVECTORS, STORED, TOKENIZED, UNINVERTIBLE, USE_DOCVALUES_AS_STORED
-
-
Constructor Summary
Constructors Constructor Description LatLonPointSpatialField()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkSupportsDocValues()
Called byFieldType.checkSchemaField(SchemaField)
if the field has docValues.static String
decodeDocValueToString(long value)
Decodes the docValues number into latitude and longitude components, formatting as "lat,lon".protected boolean
enableDocValuesByDefault()
Returns whether this field type should enable docValues by default for schemaVersion >= 1.7.void
inform(IndexSchema schema)
Informs theIndexSchema
provided by theschema
parameter of an event (e.g., a newFieldType
was added, etc.protected LatLonPointSpatialField.LatLonPointSpatialStrategy
newSpatialStrategy(String fieldName)
Called fromAbstractSpatialFieldType.getStrategy(String)
upon first use by fieldName.String
toExternal(org.apache.lucene.index.IndexableField f)
Convert the stored-field format to an external (string, human readable) value-
Methods inherited from class org.apache.solr.schema.AbstractSpatialFieldType
createField, createFields, createSpatialQuery, getDistanceUnits, getFieldQuery, getQueryFromSpatialArgs, getSortField, getSpatialContext, getSpecializedExistenceQuery, getSpecializedRangeQuery, getSphereRadius, getStoredValue, getStrategy, getSupportedScoreModes, getUninversionType, getValueSource, getValueSourceFromSpatialArgs, init, isPolyField, newSpatialArgsParser, parseDistanceUnits, parseShape, parseSpatialArgs, shapeToString, write
-
Methods inherited from class org.apache.solr.schema.FieldType
checkSchemaField, createField, getAnalyzerProperties, getClassArg, getDefaultMultiValueSelectorForSort, getDocValuesFormat, getExistenceQuery, getFieldTermQuery, getIndexAnalyzer, getNamedPropertyValues, getNonFieldPropertyArgs, getNumberType, getNumericSort, getPostingsFormat, getPrefixQuery, getQueryAnalyzer, getRangeQuery, getRewriteMethod, getSetQuery, getSimilarity, getSimilarityFactory, getSingleValueSource, getSortedNumericSortField, getSortedSetSortField, getSortField, getStringSort, getTypeName, hasProperty, indexedToReadable, indexedToReadable, isExplicitAnalyzer, isExplicitQueryAnalyzer, isMultiValued, isPointField, isTokenized, isUtf8Field, marshalBase64SortValue, marshalSortValue, marshalStringSortValue, multiValuedFieldCache, readableToIndexed, readableToIndexed, restrictProps, setArgs, setIndexAnalyzer, setIsExplicitAnalyzer, setIsExplicitQueryAnalyzer, setQueryAnalyzer, setSimilarity, storedToIndexed, storedToReadable, supportsAnalyzers, toInternal, toNativeType, toObject, toObject, toString, treatUnboundedRangeAsExistence, unmarshalBase64SortValue, unmarshalSortValue, unmarshalStringSortValue, useDocValuesAsStored, write
-
-
-
-
Method Detail
-
checkSupportsDocValues
protected void checkSupportsDocValues()
Description copied from class:FieldType
Called byFieldType.checkSchemaField(SchemaField)
if the field has docValues. By default none do.- Overrides:
checkSupportsDocValues
in classFieldType
-
enableDocValuesByDefault
protected boolean enableDocValuesByDefault()
Description copied from class:FieldType
Returns whether this field type should enable docValues by default for schemaVersion >= 1.7. This should not be enabled for fields that did not have docValues implemented by Solr 9.7, as users may have indexed documents without docValues (since they weren't supported). Flipping the default docValues values when they upgrade to a new version will break their index compatibility.New field types can enable this without issue, as long as they support docValues.
- Overrides:
enableDocValuesByDefault
in classFieldType
-
inform
public void inform(IndexSchema schema)
Description copied from interface:SchemaAware
Informs theIndexSchema
provided by theschema
parameter of an event (e.g., a newFieldType
was added, etc.- Specified by:
inform
in interfaceSchemaAware
- Parameters:
schema
- TheIndexSchema
instance that inform of the update to.
-
newSpatialStrategy
protected LatLonPointSpatialField.LatLonPointSpatialStrategy newSpatialStrategy(String fieldName)
Description copied from class:AbstractSpatialFieldType
Called fromAbstractSpatialFieldType.getStrategy(String)
upon first use by fieldName. }- Specified by:
newSpatialStrategy
in classAbstractSpatialFieldType<LatLonPointSpatialField.LatLonPointSpatialStrategy>
-
toExternal
public String toExternal(org.apache.lucene.index.IndexableField f)
Description copied from class:FieldType
Convert the stored-field format to an external (string, human readable) value- Overrides:
toExternal
in classFieldType
- See Also:
FieldType.toInternal(java.lang.String)
-
decodeDocValueToString
public static String decodeDocValueToString(long value)
Decodes the docValues number into latitude and longitude components, formatting as "lat,lon". The encoding is governed byLatLonDocValuesField
. The decimal output representation is reflective of the available precision.- Parameters:
value
- Non-null; stored location field data- Returns:
- Non-null; "lat, lon"
-
-