Mapping of Solr types
Reference information of DataStax Enterprise mapping of Solr types to CQL types and Cassandra validators.
This table shows the DataStax Enterprise mapping of Solr types to CQL types and Cassandra validators:
Solr Type | CQL type | Cassandra validator | Description |
---|---|---|---|
AsciiStrField | ascii | AsciiType | Indexed as a standard Solr StrField |
BCDIntField | int | Int32Type | Binary-coded decimal (BCD) integer |
BCDLongField | bigint | LongType | BCD long integer |
BCDStrField | text, varchar | UTF8Type | BCD string |
BinaryField | blob | BytesType | Binary data |
BoolField | boolean | BooleanType | True (1, t, or T) or False (not 1, t, or T) |
ByteField | int | Int32Type | Contains an 8-bit number value |
DateField | timestamp | DateType | Point in time with millisecond precision |
DecimalStrField | decimal | DecimalType | Indexed as a standard Solr StrField |
DoubleField | double | DoubleType | Double (64-bit IEEE floating point) |
EnumField | text, varchar | UTF8Type | A closed set having a pre-determined sort order |
ExternalFileField | text, varchar | UTF8Type | Values from disk file |
FloatField | float | FloatType | 32-bit IEEE floating point |
GeoHashField | text, varchar | UTF8Type | Geohash lat/lon pair represented as a string |
InetField | inet | InetAddressType | InetField is currently implemented and indexed as a standard Solr StrField |
IntField | int | Int32Type | 32-bit signed integer |
LatLonType | text, varchar | UTF8Type | Latitude/Longitude 2-D point, latitude first |
LongField | bigint | LongType | Long integer (64-bit signed integer) |
PointType | text, varchar | UTF8Type | Arbitrary n-dimensional point for spatial search |
RandomSortField | text, varchar | UTF8Type | Dynamic field in random order |
SimpleDateField | date | SimpleDateType | TrieDateField holding a CQL date |
ShortField | int | Int32Type | Short integer |
SortableDoubleField | double | DoubleType | Numerically sorted doubles |
SortableFloatField | float | FloatType | Numerically sorted floating point |
SortableIntField | int | Int32Type | Numerically sorted integer |
SortableLongField | bigint | LongType | Numerically sorted long integer |
SpatialRecursivePrefixTreeFieldType | PointType | PointType | Spatial field type for a point geospatial context |
SpatialRecursivePrefixTreeFieldType | text, varchar | UTF8Type | Spatial field type for a geospatial context |
StrField | text, varchar | UTF8Type | String (UTF-8 encoded string or Unicode) |
TextField | text, varchar | UTF8Type | Text, usually multiple words or tokens |
TimeField | time | TimeType | A TrieLongField holding a CQL 'time' |
TimeUUIDField | timeuuid | TimeUUIDType | Type 1 Universally Unique Identifier (UUID) |
TrieDateField | timestamp | DateType | Date field for Lucene TrieRange processing, supports indexing negative dates |
TrieDoubleField | double | DoubleType | Double field for Lucene TrieRange processing |
TrieField | N/A | N/A | Same as any Trie field type |
TrieFloatField | float | FloatType | Floating point field for Lucene TrieRange processing |
TrieIntField | int, smallint | Int32Type, ShortType | 32-bit signed integer field for Lucene TrieRange processing |
TrieIntField | tinyint | ByteType | 32-bit signed integer field for Lucene TrieRange processing |
TrieLongField | bigint | LongType | Long field for Lucene TrieRange processing |
UUIDField | uuid, timeuuid | UUIDType | Universally Unique Identifier (UUID) |
VarIntStrField | varint | IntegerType | Indexed as a standard Solr StrField |
Other | text, varchar | UTF8Type | Indexed as a standard Solr StrField |
For efficiency in operations such as range queries, DataStax recommends using Trie types.
Consider the following information:
- BCD
- A relatively inefficient encoding that offers the benefits of quick decimal calculations and quick conversion to a string.
- BoolField
- Due to SOLR-7264, setting docValues=true on a boolean field in the Solr schema does not work. A workaround for boolean docValues is to use 0 and 1 with a TrieIntField.
- SortableDoubleField/DoubleType
- For plain types (DoubleField, IntField, and so on), sorting is lexicographical instead of numeric.
- TrieDateField
- Supports indexing negative dates, for example: -28011-12-02T00:00:00.002Z.
- TrieField
- Used with a type attribute and value: integer, long, float, double, date.
- UUIDField
- DataStax Enterprise supports the Cassandra TimeUUID type. A value of this type is a Type 1 UUID that includes the time of its generation. Values are sorted, conflict-free timestamps. For example, use the TimeUUID type to identify a column, such as a blog entry, by its timestamp and allow multiple clients to write to the same partition key simultaneously. To find data mapped from a Cassandra TimeUUID to a Solr UUIDField, search for the entire UUID value, not just its time component.
Mapping of CQL collections
DSE Search maps collections as follows:
- Collection list and set: multi-valued field. See Options for storing field cache and Example: copy fields and docValues
- Collection maps: Dynamic fields.
The name of the dynamic field minus the wildcard is the map name. For example, a map column name dyna* is mapped to dyna. Inner keys are mapped to the full field name.