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 recomended instead.
UUID.toString()
,
UUID.randomUUID()
FieldType.DefaultAnalyzer, FieldType.MultiValueSelector
ANALYZER, args, CHAR_FILTER, CHAR_FILTERS, CLASS_NAME, docValuesFormat, falseProperties, FILTER, FILTERS, INDEX, INDEX_ANALYZER, MULTI_TERM, MULTI_TERM_ANALYZER, POLY_FIELD_SEPARATOR, postingsFormat, properties, QUERY, QUERY_ANALYZER, similarity, SIMILARITY, similarityFactory, TOKENIZER, trueProperties, TYPE, TYPE_NAME, typeName
BINARY, DOC_VALUES, INDEXED, 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, 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) |
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
|
checkSchemaField, createFields, getUninversionType, getValueSource, marshalSortValue, toObject, unmarshalSortValue
createField, createField, getAnalyzerProperties, getClassArg, getDocValuesFormat, getFieldQuery, getIndexAnalyzer, getIndexOptions, getNamedPropertyValues, getNonFieldPropertyArgs, getNumericType, getPostingsFormat, getPrefixQuery, getQueryAnalyzer, getRangeQuery, getRewriteMethod, getSimilarity, getSimilarityFactory, getSingleValueSource, getStringSort, getTypeName, hasProperty, indexedToReadable, indexedToReadable, isExplicitAnalyzer, isExplicitQueryAnalyzer, isMultiValued, isPolyField, isTokenized, marshalBase64SortValue, marshalStringSortValue, multiValuedFieldCache, readableToIndexed, readableToIndexed, restrictProps, setArgs, setIndexAnalyzer, setIsExplicitAnalyzer, setIsExplicitQueryAnalyzer, setQueryAnalyzer, setSimilarity, storedToIndexed, storedToReadable, supportsAnalyzers, toExternal, toNativeType, toString, unmarshalBase64SortValue, unmarshalStringSortValue, useDocValuesAsStored
protected void init(IndexSchema schema, Map<String,String> args)
FieldType
public SortField getSortField(SchemaField field, boolean reverse)
FieldType
getSortField
in class StrField
SchemaField.checkSortability()
public void write(TextResponseWriter writer, String name, IndexableField f) throws IOException
FieldType
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)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.