Package org.apache.solr.schema
Class UUIDField
java.lang.Object
org.apache.solr.schema.FieldProperties
org.apache.solr.schema.FieldType
org.apache.solr.schema.PrimitiveFieldType
org.apache.solr.schema.StrField
org.apache.solr.schema.UUIDField
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.
- See Also:
-
Nested Class Summary
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.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, typeNameFields 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 -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.SortFieldgetSortField(SchemaField field, boolean reverse) Returns the SortField instance that should be used to sort fields of this type.protected voidinit(IndexSchema schema, Map<String, String> args) subclasses should initialize themselves with the args provided and remove valid arguments.toInternal(String val) Generates a UUID if val is either null, empty or "NEW".toInternal(UUID uuid) voidwrite(TextResponseWriter writer, String name, org.apache.lucene.index.IndexableField f) calls back to TextResponseWriter to write the field valueMethods inherited from class org.apache.solr.schema.StrField
createFields, getBytesRef, getSingleValueSource, getUninversionType, getValueSource, isUtf8Field, marshalSortValue, toObject, unmarshalSortValueMethods inherited from class org.apache.solr.schema.PrimitiveFieldType
checkSupportsDocValues, enableDocValuesByDefault, getDefaultMultiValueSelectorForSortMethods inherited from class org.apache.solr.schema.FieldType
checkSchemaField, createField, createField, getAnalyzerProperties, getClassArg, getDocValuesFormat, getExistenceQuery, getFieldQuery, getFieldTermQuery, 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, toNativeType, toObject, toString, treatUnboundedRangeAsExistence, unmarshalBase64SortValue, unmarshalStringSortValue, useDocValuesAsStored, write
-
Constructor Details
-
UUIDField
public UUIDField()
-
-
Method Details
-
init
Description copied from class:FieldTypesubclasses should initialize themselves with the args provided and remove valid arguments. leftover arguments will cause an exception. Common boolean properties have already been handled. -
getSortField
Description copied from class:FieldTypeReturns the SortField instance that should be used to sort fields of this type.- Overrides:
getSortFieldin classStrField- See Also:
-
write
public void write(TextResponseWriter writer, String name, org.apache.lucene.index.IndexableField f) throws IOException Description copied from class:FieldTypecalls back to TextResponseWriter to write the field valueSub-classes should prefer using
FieldType.toExternal(IndexableField)orFieldType.toObject(IndexableField)to get the writeable external value offinstead of directly usingf.stringValue()orf.binaryValue()- Overrides:
writein classStrField- Throws:
IOException
-
toInternal
Generates a UUID if val is either null, empty or "NEW".Otherwise it behaves much like a StrField but checks that the value given is indeed a valid UUID.
- Overrides:
toInternalin classFieldType- Parameters:
val- The value of the field- See Also:
-
toInternal
-