public abstract class PointField extends NumericFieldType
IntPoint, LongPoint, FloatPoint and
DoublePoint.
See PointRangeQuery for more details.
It supports integer, float, long and double types. See subclasses for details.
DocValues are supported for single-value cases (NumericDocValues).
FieldCache is not supported for PointFields, so sorting, faceting, etc on these fields require the use of docValues="true" in the schema.FieldType.DefaultAnalyzer, FieldType.MultiValueSelector| Modifier and Type | Field and Description |
|---|---|
static boolean |
TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS
The Test framework can set this global variable to instruct PointField that
(on init) it should be tollerant of the
precisionStep argument used by TrieFields. |
typeANALYZER, 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, typeNameBINARY, 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 and Description |
|---|
PointField() |
| Modifier and Type | Method and Description |
|---|---|
List<IndexableField> |
createFields(SchemaField sf,
Object value)
Given a
SchemaField, create one or more IndexableField instances |
protected abstract Query |
getExactQuery(SchemaField field,
String externalVal) |
Query |
getFieldQuery(QParser parser,
SchemaField field,
String externalVal)
Returns a Query instance for doing searches against a field.
|
abstract Query |
getPointRangeQuery(QParser parser,
SchemaField field,
String min,
String max,
boolean minInclusive,
boolean maxInclusive) |
Query |
getPrefixQuery(QParser parser,
SchemaField sf,
String termStr)
Returns a Query instance for doing prefix searches on this field type.
|
Query |
getRangeQuery(QParser parser,
SchemaField field,
String min,
String max,
boolean minInclusive,
boolean maxInclusive)
Returns a Query instance for doing range searches on this field type.
|
Query |
getSetQuery(QParser parser,
SchemaField field,
Collection<String> externalVals) |
ValueSource |
getSingleValueSource(FieldType.MultiValueSelector choice,
SchemaField field,
QParser parser)
Method for dynamically building a ValueSource based on a single value of a multivalued field.
|
protected abstract ValueSource |
getSingleValueSource(SortedNumericSelector.Type choice,
SchemaField field)
Helper method that will only be called for multivalued Point fields that have doc values.
|
SortField |
getSortField(SchemaField field,
boolean top)
Returns the SortField instance that should be used to sort fields
of this type.
|
protected abstract StoredField |
getStoredField(SchemaField sf,
Object value) |
protected abstract String |
indexedToReadable(BytesRef indexedForm) |
CharsRef |
indexedToReadable(BytesRef indexedForm,
CharsRefBuilder charsRef)
Given an indexed term, append the human readable representation
|
String |
indexedToReadable(String indexedForm)
Given an indexed term, return the human readable representation
|
protected void |
init(IndexSchema schema,
Map<String,String> args)
NOTE: This method can be removed completely when
TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS is removed |
protected boolean |
isFieldUsed(SchemaField field) |
boolean |
isPointField() |
boolean |
isTokenized()
Returns true if fields of this type should be tokenized
|
boolean |
multiValuedFieldCache()
Returns true if a single field value of this type has multiple logical values
for the purposes of faceting, sorting, etc.
|
String |
storedToIndexed(IndexableField f)
Given the stored field, return the indexed form
|
String |
storedToReadable(IndexableField f)
Given the stored field, return the human readable representation
|
String |
toInternal(String val)
Convert an external value (from XML update command or from query string)
into the internal format for both storing and indexing (which can be modified by any analyzers).
|
BytesRef |
toInternalByteRef(String val) |
void |
write(TextResponseWriter writer,
String name,
IndexableField f)
calls back to TextResponseWriter to write the field value
|
getDocValuesRangeQuery, getNumberType, getRangeQueryForFloatDoubleDocValues, getRangeQueryForMultiValuedDoubleDocValues, getRangeQueryForMultiValuedFloatDocValues, numericDocValuesRangeQuerycheckSupportsDocValues, getDefaultMultiValueSelectorForSortcheckSchemaField, createField, createField, getAnalyzerProperties, getClassArg, getDocValuesFormat, getIndexAnalyzer, getNamedPropertyValues, getNonFieldPropertyArgs, getNumericSort, getPostingsFormat, getQueryAnalyzer, getRewriteMethod, getSimilarity, getSimilarityFactory, getSortedNumericSortField, getSortedSetSortField, getSortField, getStringSort, getTypeName, getUninversionType, getValueSource, hasProperty, isExplicitAnalyzer, isExplicitQueryAnalyzer, isMultiValued, isPolyField, isUtf8Field, marshalBase64SortValue, marshalSortValue, marshalStringSortValue, readableToIndexed, readableToIndexed, restrictProps, setArgs, setIndexAnalyzer, setIsExplicitAnalyzer, setIsExplicitQueryAnalyzer, setQueryAnalyzer, setSimilarity, supportsAnalyzers, toExternal, toNativeType, toObject, toObject, toString, unmarshalBase64SortValue, unmarshalSortValue, unmarshalStringSortValue, useDocValuesAsStored, writepublic static boolean TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS
The Test framework can set this global variable to instruct PointField that
(on init) it should be tollerant of the precisionStep argument used by TrieFields.
This allows for simple randomization of TrieFields and PointFields w/o extensive duplication
of <fieldType/> declarations.
NOTE: When TrieField is removed, this boolean must also be removed
protected void init(IndexSchema schema, Map<String,String> args)
TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS is removedinit in class PrimitiveFieldTypepublic boolean isPointField()
isPointField in class FieldTypepublic final ValueSource getSingleValueSource(FieldType.MultiValueSelector choice, SchemaField field, QParser parser)
FieldTypeSchemaField that is in fact not-multivalued, in which case it delegates to
FieldType.getValueSource(org.apache.solr.schema.SchemaField, org.apache.solr.search.QParser)getSingleValueSource in class FieldTypeFieldType.MultiValueSelectorprotected abstract ValueSource getSingleValueSource(SortedNumericSelector.Type choice, SchemaField field)
choice - the selector Type to use, will never be nullfield - the field to use, guaranteed to be multivalued.FieldType.getSingleValueSource(MultiValueSelector,SchemaField,QParser)public boolean isTokenized()
FieldTypeisTokenized in class FieldTypepublic boolean multiValuedFieldCache()
FieldTypemultiValuedFieldCache in class FieldTypepublic Query getSetQuery(QParser parser, SchemaField field, Collection<String> externalVals)
getSetQuery in class FieldTypepublic Query getFieldQuery(QParser parser, SchemaField field, String externalVal)
FieldTypegetFieldQuery in class FieldTypeparser - The QParser calling the methodfield - The SchemaField of the field to searchexternalVal - The String representation of the value to searchQuery instance. This implementation returns a TermQuery but overriding queries may notprotected abstract Query getExactQuery(SchemaField field, String externalVal)
public abstract Query getPointRangeQuery(QParser parser, SchemaField field, String min, String max, boolean minInclusive, boolean maxInclusive)
public Query getRangeQuery(QParser parser, SchemaField field, String min, String max, boolean minInclusive, boolean maxInclusive)
FieldTypeSolrQueryParser
currently passes part1 and part2 as null if they are '*' respectively. minInclusive and maxInclusive are both true
currently by SolrQueryParser but that may change in the future. Also, other QueryParser implementations may have
different semantics.
Sub-classes should override this method to provide their own range query implementation. They should strive to handle nulls in part1 and/or part2 as well as unequal minInclusive and maxInclusive parameters gracefully.
getRangeQuery in class FieldTypeparser - the QParser calling the methodfield - the schema fieldmin - the lower boundary of the range, nulls are allowed.max - the upper boundary of the range, nulls are allowedminInclusive - whether the minimum of the range is inclusive or notmaxInclusive - whether the maximum of the range is inclusive or notpublic String storedToReadable(IndexableField f)
FieldTypestoredToReadable in class FieldTypepublic String toInternal(String val)
FieldTypetoInternal in class FieldTypeFieldType.toExternal(org.apache.lucene.index.IndexableField)public void write(TextResponseWriter writer, String name, IndexableField f) throws IOException
FieldTypewrite in class FieldTypeIOExceptionpublic String storedToIndexed(IndexableField f)
FieldTypestoredToIndexed in class FieldTypepublic CharsRef indexedToReadable(BytesRef indexedForm, CharsRefBuilder charsRef)
FieldTypeindexedToReadable in class FieldTypepublic String indexedToReadable(String indexedForm)
FieldTypeindexedToReadable in class FieldTypepublic Query getPrefixQuery(QParser parser, SchemaField sf, String termStr)
FieldTypeSub-classes should override this method to provide their own range query implementation.
getPrefixQuery in class FieldTypeparser - the QParser calling the methodsf - the schema fieldtermStr - the term string for prefix queryprotected boolean isFieldUsed(SchemaField field)
public List<IndexableField> createFields(SchemaField sf, Object value)
FieldTypeSchemaField, create one or more IndexableField instancescreateFields in class FieldTypesf - the SchemaFieldvalue - The value to add to the fieldIndexableFieldFieldType.createField(SchemaField, Object),
FieldType.isPolyField()protected abstract StoredField getStoredField(SchemaField sf, Object value)
public SortField getSortField(SchemaField field, boolean top)
FieldTypeCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.