Understanding schema field types

Reference of CQL data type to Solr field type mappings and compatibility between them.

DataStax Enterprise Search index schemas define the CQL to Solr type mapping. A field type definition is required to parse data from a CQL column into the corresponding Solr field in the index. The fieldType definitions support processing instructions in the analyzer section.

Restriction: Decimal and varint are indexed as strings. Apache Lucene® does not support the precision required by these numeric types. Range and sorting queries do not work as expected if a table uses the decimal and varint types; equality searches work as expected.
Table 1. Default CQL to Solr type mapping
CQL data type Solr field type docValues
ascii AsciiStrField false
bigint TrieLongField true
blob BinaryField not supported
boolean BoolField false
date SimpleDateField not supported
decimal DecimalStrField false
double TrieDoubleField true
float TrieFloatField true
inet InetField false
int TrieIntField true
smallint TrieIntField true
text TextField false
time TimeField true
timestamp TrieDateField true
timeuuid TimeUUIDField true
tinyint TrieIntField true
uuid UUIDField true
varchar TextField not supported
varint VarIntStrField false
tuple/user defined type (UDT) TupleField false
Note: The list and set collection types are Solr multiValued fields; maps are dynamicFields.

CQL data type compatibility with Solr field type classes

DSE Search index schema defines the Solr field type of each indexed CQL column. The default mapping provides support for the most common use cases. To perform more advanced searches or a different type of analysis on a column, use the following compatibility matrix to determine the supported CQL to Solr type mappings.

Table 2. Compatibility matrix
CQL data type Solr field type DSE type Description
ascii AsciiStrField AsciiType Indexed as a standard Solr StrField.
blob BinaryField BytesType Binary data.
boolean BoolField BooleanType True (1, t, or T) or False (not 1, t, or T)
DateRangeType DateRangeField DateRangeType Point-in-time with millisecond precision with support for date ranges. See Using date ranges in solr_query.
decimal DecimalStrField DecimalType Indexed as a standard Solr StrField.
text, varchar EnumField UTF8Type A closed set with a pre-determined sort order.
text, varchar ExternalFileField UTF8Type Values from disk file.
text, varchar GeoHashField UTF8Type Hash of coordinate pair (latitude,longitude) stored as a string.
inet InetField InetAddressType InetField is implemented and indexed as a standard Solr StrField.
text, varchar LatLonType UTF8Type Latitude/Longitude 2-D point, latitude first.
text, varchar PointType UTF8Type Coordinate values, two per point for spatial search.
text, varchar RandomSortField UTF8Type Dynamic field in random order.
date SimpleDateField SimpleDateType TrieDateField holding a CQL date.
PointType SpatialRecursivePrefixTreeFieldType PointType Spatial field type for a point geospatial context.
text, varchar SpatialRecursivePrefixTreeFieldType UTF8Type Spatial field type for a geospatial context.
text, varchar StrField UTF8Type String (UTF-8 encoded string or Unicode).
text, varchar TextField UTF8Type Text, usually multiple words or tokens.
time TimeField TimeType A TrieLongField holding a CQL time.
timeuuid TimeUUIDField TimeUUIDType Type 1 Universally Unique Identifier (UUID).
timestamp TrieDateField DateType Date field for Lucene TrieRange processing; supports indexing negative dates.
double TrieDoubleField DoubleType Double field for Lucene TrieRange processing.
N/A TrieField N/A Same as any Trie field type.
float TrieFloatField FloatType Floating point field for Lucene TrieRange processing.
int, smallint TrieIntField Int32Type, ShortType 32-bit signed integer field for Lucene TrieRange processing.
tinyint TrieIntField ByteType 32-bit signed integer field for Lucene TrieRange processing.
bigint TrieLongField LongType Long field for Lucene TrieRange processing.
uuid, timeuuid UUIDField UUIDType Universally Unique Identifier (UUID).
varint VarIntStrField IntegerType Indexed as a standard Solr StrField.
text, varchar Other UTF8Type Indexed as a standard Solr StrField.