Defining index field types
Default field type definitions
A field type definition is required for parsing CQL columns into the corresponding Solr field type. Add processing instructions to the analyzer section of the fieldType definition.
TrieField
types
Used with a type attribute and value: integer, long, float, double, date.
TrieDoubleField
-
<fieldType class="org.apache.solr.schema.TrieDoubleField" name="TrieDoubleField"/>
TrieDateField
-
Date field for Lucene TrieRange processing, supports indexing negative date. For example:
-28011-12-02T00:00:00.002Z
. To insert negative dates for the CQL timestamp, insert an epoch time in milliseconds. TheTimestampType
does not accept a textual representation of negative dates.<fieldType class="org.apache.solr.schema.TrieDateField" name="TrieDateField"/>
TrieFloatField
-
<fieldType class="org.apache.solr.schema.TrieFloatField" name="TrieFloatField"/>
StringField types
VarIntStrField
-
Define with the DataStax class to convert a CQL varint.
<fieldType class="com.datastax.bdp.search.solr.core.types.VarIntStrField" name="VarIntStrField"/>
AsciiStrField
-
Converts a CQL ascii into a standard Solr StrField.
<fieldType class="com.datastax.bdp.search.solr.core.types.AsciiStrField" name="AsciiStrField"/>
SimpleDateField
-
Define with the DataStax class to convert a CQL date field into a compatible Solr date field.
<fieldType class="com.datastax.bdp.search.solr.core.types.SimpleDateField" name="SimpleDateField"/>
BoolField
-
Due to SOLR-7264, setting
docValues
totrue
on a boolean field in the Solr schema does not work. A workaround for booleandocValues
is to use 0 and 1 with aTrieIntField
.<fieldType class="org.apache.solr.schema.BoolField" name="BoolField"/>
BinaryField
-
<fieldType class="org.apache.solr.schema.BinaryField" name="BinaryField"/>
UUIDField
-
A value of this type is a Type 1 UUID that includes the time of its generation. Values are sorted by 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 aTimeUUID
to aUUIDField
, search for the entire UUID value, not just its time component.<fieldType class="org.apache.solr.schema.UUIDField" name="UUIDField"/>
Default index field definitions for CQL column types
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 these types. |
CQL data type | Field type name | docValues |
multiValued |
---|---|---|---|
|
false |
false |
|
|
true |
false |
|
|
not supported |
false |
|
|
false |
false |
|
|
not supported |
false |
|
|
false |
false |
|
|
true |
false |
|
|
true |
false |
|
|
false |
false |
|
|
true |
false |
|
|
true |
false |
|
|
false |
false |
|
|
true |
false |
|
|
true |
false |
|
|
true |
false |
|
|
true |
false |
|
|
true |
false |
|
|
not supported |
false |
|
|
false |
false |
|
true |
|||
true |
|||
true |
true |
||
|
false |
false |
CQL data type compatibility with field type classes
CQL | Field name | Class | Description |
---|---|---|---|
|
|
|
Indexed as a standard Solr StrField. |
|
|
|
Binary data. |
|
|
|
True (1, t, or T) or False (not 1, t, or T) |
|
|
|
Point-in-time with millisecond precision with support for date ranges.
See Using date ranges in |
|
|
|
Indexed as a standard Solr |
|
|
|
A closed set with a pre-determined sort order. |
|
|
|
Values from disk file. |
|
|
|
Hash of coordinate pair (latitude,longitude) stored as a string. |
inet |
InetField |
InetAddressType |
InetField is implemented and indexed as a standard Solr StrField. |
|
|
|
Latitude/Longitude 2-D point, latitude first. |
|
|
|
Arbitrary n-dimensional point for spatial search. |
|
|
|
Dynamic field in random order. |
|
|
|
|
|
|
|
Spatial field type for a point geospatial context. |
|
|
|
Spatial field type for a geospatial context. |
|
|
|
String (UTF-8 encoded string or Unicode). |
|
|
|
Text, usually multiple words or tokens. |
|
|
|
A |
|
|
|
Type 1 Universally Unique Identifier (UUID). |
|
|
|
Date field for Lucene |
|
|
|
Double field for Lucene |
N/A |
|
N/A |
Same as any |
|
|
|
Floating point field for Lucene |
|
|
|
32-bit signed integer field for Lucene |
|
|
|
32-bit signed integer field for Lucene |
|
|
|
Long field for Lucene |
|
|
|
Universally Unique Identifier (UUID). |
|
|
|
Indexed as a standard Solr |
|
Other |
|
Indexed as a standard Solr |