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.

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 1. Compatibility matrix
CQL data type Solr field type Supports docValues Description
ascii AsciiStrField false Indexed as a standard Solr StrField.
bigint TrieLongField true Long field for Lucene TrieRange processing.
blob BinaryField not supported Binary data.
boolean BoolField false True (1, t, or T) or False (not 1, t, or T)
counter not indexable N/A 64-bit signed integer.
date SimpleDateField (DataStax custom field) not supported TrieDateField holding a CQL date.
DateRangeType DateRangeField not supported Point-in-time with millisecond precision with support for date ranges. See Using date ranges in solr_query.
decimal DecimalStrField false Indexed as a standard Solr StrField.
double TrieDoubleField true Double field for Lucene TrieRange processing.
DseExecutorState not indexable N/A Reserved data type for Spark.
duration not indexable N/A Range of time, such as 12h30m.
text, varchar EnumField not supposed A closed set with a pre-determined sort order.
text, varchar ExternalFileField not supported Values from disk file.
float TrieFloatField true Floating point field for Lucene TrieRange processing.
text, varchar GeoHashField not supported Hash of coordinate pair (latitude,longitude) stored as a string.
inet InetField false InetField is implemented and indexed as a standard Solr StrField.
int TrieIntField true 32-bit signed integer field for Lucene TrieRange processing.
text, varchar LatLonType not supported Latitude/Longitude 2-D point, latitude first.
LineStringType SpatialRecursivePrefixTreeFieldType true Spatial field type for a point geospatial context.
PointType SpatialRecursivePrefixTreeFieldType true Spatial field type for a point geospatial context.
text, varchar PointType Coordinate values, two per point for spatial search.
PolygonType SpatialRecursivePrefixTreeFieldType true Spatial field type for a point geospatial context.
text, varchar RandomSortField not supported Dynamic field in random order.
text, varchar SpatialRecursivePrefixTreeFieldType Spatial field type for a geospatial context.
smallint TrieIntField true 32-bit signed integer field for Lucene TrieRange processing.
text, varchar StrField false String (UTF-8 encoded string or Unicode).
text TextField false Text, usually multiple words or tokens.
time TimeField true A TrieLongField holding a CQL time.
timestamp TrieDateField true Date field for Lucene TrieRange processing; supports indexing negative dates.
timeuuid TimeUUIDField true Type 1 Universally Unique Identifier (UUID).
N/A TrieField true Same as any Trie field type.
tinyint TrieIntField true 32-bit signed integer field for Lucene TrieRange processing.
tuple TupleField false Fixed length set of elements of different types.
user defined type (UDT) TupleField false User-defined type.
uuid UUIDField true Universally Unique Identifier (UUID).
varchar TextField not supported Text, usually multiple words or tokens.
varint VarIntStrField false Indexed as a standard Solr StrField.
Note: The list and set collection types are Solr multiValued fields; maps are dynamicFields. The counter, duration, and DseExecutorState types are not Solr indexable.