Field Types Included with Solr

The following table lists the field types that are available in Solr. The org.apache.solr.schema package includes all the classes listed in this table.

ClassDescription
BinaryFieldBinary data.
BoolFieldContains either true or false. Values of 1, t, or T in the first character are interpreted as true. Any other values in the first character are interpreted as false.
CollationFieldSupports Unicode collation for sorting and range queries. The ICUCollationField is a better choice if you can use ICU4J. See the section Unicode Collation for more information.
CurrencyFieldDeprecated. Use CurrencyFieldType instead.
CurrencyFieldTypeSupports currencies and exchange rates. See the section Working with Currencies and Exchange Rates for more information.
DateRangeFieldSupports indexing date ranges, to include point in time date instances as well (single-millisecond durations). See the section Working with Dates for more detail on using this field type. Consider using this field type even if it’s just for date instances, particularly when the queries typically fall on UTC year/month/day/hour, etc., boundaries.
DatePointFieldDate field. Represents a point in time with millisecond precision, encoded using a "Dimensional Points" based data structure that allows for very efficient searches for specific values, or ranges of values. See the section Working with Dates for more details on the supported syntax. For single valued fields, docValues="true" must be used to enable sorting.
DoublePointFieldDouble field (64-bit IEEE floating point). This class encodes double values using a "Dimensional Points" based data structure that allows for very efficient searches for specific values, or ranges of values. For single valued fields, docValues="true" must be used to enable sorting.
ExternalFileFieldPulls values from a file on disk. See the section Working with External Files and Processes for more information.
EnumFieldDeprecated. Use EnumFieldType instead.
EnumFieldTypeAllows defining an enumerated set of values which may not be easily sorted by either alphabetic or numeric order (such as a list of severities, for example). This field type takes a configuration file, which lists the proper order of the field values. See the section Working with Enum Fields for more information.
FloatPointFieldFloating point field (32-bit IEEE floating point). This class encodes float values using a "Dimensional Points" based data structure that allows for very efficient searches for specific values, or ranges of values. For single valued fields, docValues="true" must be used to enable sorting.
ICUCollationFieldSupports Unicode collation for sorting and range queries. See the section Unicode Collation for more information.
IntPointFieldInteger field (32-bit signed integer). This class encodes int values using a "Dimensional Points" based data structure that allows for very efficient searches for specific values, or ranges of values. For single valued fields, docValues="true" must be used to enable sorting.
LatLonPointSpatialFieldA latitude/longitude coordinate pair; possibly multi-valued for multiple points. Usually it’s specified as "lat,lon" order with a comma. See the section Spatial Search for more information.
LatLonTypeDeprecated. Consider using the LatLonPointSpatialField instead. A single-valued latitude/longitude coordinate pair. Usually it’s specified as "lat,lon" order with a comma. See the section Spatial Search for more information.
LongPointFieldLong field (64-bit signed integer). This class encodes foo values using a "Dimensional Points" based data structure that allows for very efficient searches for specific values, or ranges of values. For single valued fields, docValues="true" must be used to enable sorting.
PointTypeA single-valued n-dimensional point. It’s both for sorting spatial data that is not lat-lon, and for some more rare use-cases. (NOTE: this is not related to the "Point" based numeric fields). See Spatial Search for more information.
PreAnalyzedField

Provides a way to send to Solr serialized token streams, optionally with independent stored values of a field, and have this information stored and indexed without any additional text processing.

Configuration and usage of PreAnalyzedField is documented in the section Working with External Files and Processes.

RandomSortFieldDoes not contain a value. Queries that sort on this field type will return results in random order. Use a dynamic field to use this feature.
SpatialRecursivePrefixTreeFieldType(RPT for short) Accepts latitude comma longitude strings or other shapes in WKT format. See Spatial Search for more information.
StrFieldString (UTF-8 encoded string or Unicode). Strings are intended for small fields and are not tokenized or analyzed in any way. They have a hard limit of slightly less than 32K.
SortableTextFieldA specialized version of TextField that allows (and defaults to) docValues="true" for sorting on the first 1024 characters of the original string prior to analysis. The number of characters used for sorting can be overridden with the maxCharsForDocValues attribute.
TextFieldText, usually multiple words or tokens.
TrieDateFieldDeprecated. Use DatePointField instead.
TrieDoubleFieldDeprecated. Use DoublePointField instead.
TrieFloatFieldDeprecated. Use FloatPointField instead.
TrieIntFieldDeprecated. Use IntPointField instead.
TrieLongFieldDeprecated. Use LongPointField instead.
TrieFieldDeprecated. This field takes a type parameter to define the specific class of Trie* field to use; Use an appropriate Point Field type instead.
UUIDField

Universally Unique Identifier (UUID). Pass in a value of NEW and Solr will create a new 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.

All Trie* numeric and date field types have been deprecated in favor of *Point field types. Point field types are better at range queries (speed, memory, disk), however simple field:value queries underperform relative to Trie. Either accept this, or continue to use Trie fields. This shortcoming may be addressed in a future release.