public class UUIDField extends StrField
This FieldType accepts UUID string values, as well as the special value of "NEW" which triggers generation of a new random UUID.
NOTE: Configuring a UUIDField
instance with a default value of "NEW
" is not advisable for
most users when using SolrCloud (and not possible if the UUID value is
configured as the unique key field) since the result will be that each
replica of each document will get a unique UUID value.
Using UUIDUpdateProcessorFactory
to generate UUID values when
documents are added is recommended instead.
UUID.toString()
,
UUID.randomUUID()
FieldType.DefaultAnalyzer, FieldType.MultiValueSelector
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
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 and Description |
---|
UUIDField() |
Modifier and Type | Method and Description |
---|---|
SortField |
getSortField(SchemaField field,
boolean reverse)
Returns the SortField instance that should be used to sort fields
of this type.
|
protected void |
init(IndexSchema schema,
Map<String,String> args)
subclasses should initialize themselves with the args provided
and remove valid arguments.
|
String |
toInternal(String val)
Generates a UUID if val is either null, empty or "NEW".
|
String |
toInternal(UUID uuid) |
Object |
toNativeType(Object val)
Converts any Object to a java Object native to this field type
|
UUID |
toObject(IndexableField f)
Convert the stored-field format to an external object.
|
void |
write(TextResponseWriter writer,
String name,
IndexableField f)
calls back to TextResponseWriter to write the field value
|
createFields, getBytesRef, getSingleValueSource, getUninversionType, getValueSource, isUtf8Field, marshalSortValue, toObject, unmarshalSortValue
checkSupportsDocValues, getDefaultMultiValueSelectorForSort
checkSchemaField, createField, createField, getAnalyzerProperties, getClassArg, getDocValuesFormat, getExistenceQuery, getFieldQuery, getIndexAnalyzer, getNamedPropertyValues, getNonFieldPropertyArgs, getNumberType, getNumericSort, getPostingsFormat, getPrefixQuery, getQueryAnalyzer, getRangeQuery, getRewriteMethod, getSetQuery, getSimilarity, getSimilarityFactory, getSortedNumericSortField, getSortedSetSortField, getSortField, getSpecializedExistenceQuery, getSpecializedRangeQuery, getStringSort, getTypeName, hasProperty, indexedToReadable, indexedToReadable, isExplicitAnalyzer, isExplicitQueryAnalyzer, isMultiValued, isPointField, isPolyField, isTokenized, marshalBase64SortValue, marshalStringSortValue, multiValuedFieldCache, readableToIndexed, readableToIndexed, restrictProps, setArgs, setIndexAnalyzer, setIsExplicitAnalyzer, setIsExplicitQueryAnalyzer, setQueryAnalyzer, setSimilarity, storedToIndexed, storedToReadable, supportsAnalyzers, toExternal, toString, treatUnboundedRangeAsExistence, unmarshalBase64SortValue, unmarshalStringSortValue, useDocValuesAsStored, write
protected void init(IndexSchema schema, Map<String,String> args)
FieldType
public SortField getSortField(SchemaField field, boolean reverse)
FieldType
public void write(TextResponseWriter writer, String name, IndexableField f) throws IOException
FieldType
Sub-classes should prefer using FieldType.toExternal(IndexableField)
or FieldType.toObject(IndexableField)
to get the writeable external value of f
instead of directly using f.stringValue()
or f.binaryValue()
write
in class StrField
IOException
public String toInternal(String val)
toInternal
in class FieldType
val
- The value of the fieldFieldType.toInternal(java.lang.String)
public UUID toObject(IndexableField f)
FieldType
toObject
in class FieldType
FieldType.toInternal(java.lang.String)
public Object toNativeType(Object val)
FieldType
toNativeType
in class FieldType
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.