Solr field type reference for DSE Search

Definitions for Apache Solr field type for DSE Search index schema.

CQL data is parsed into DataStax Enterprise Search indexes using a corresponding Solr field type. The index schema for each table must contain the Solr field type definition along with optional advanced processing instructions.

Tip: See compatitbility matrix for CQL to Solr type mappings.

Trie field types

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. The TimestampType does not accept a textual representation of negative dates.
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='org.apache.solr.schema.TrieDateField', @name='TrieDateField'];
Results in the following schema XML:
<fieldType class="org.apache.solr.schema.TrieDateField" name="TrieDateField"/>
TrieDoubleField
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class=org.apache.solr.schema.TrieDoubleField', @name='TrieDoubleField'];
Results in the following schema XML:
<fieldType class="org.apache.solr.schema.TrieDoubleField" name="TrieDoubleField"/>
TrieFloatField
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='org.apache.solr.schema.TrieFloatField', @name='TrieFloatField'];
Results in the following schema XML:
<fieldType class="org.apache.solr.schema.TrieFloatField" name="TrieFloatField"/>
TrieIntField
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='org.apache.solr.schema.TrieIntField', @name='TrieIntField'];
Results in the following schema XML:
<fieldType class="org.apache.solr.schema.TrieIntField" name="TrieIntField"/>
TrieLongField
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='org.apache.solr.schema.TrieLongField', @name='TrieLongField'];
Results in the following schema XML:
<fieldType class="org.apache.solr.schema.TrieLongField" name="TrieLongField"/>

String field types

AsciiStrField
Converts a CQL ascii into a standard Solr StrField.
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='com.datastax.bdp.search.solr.core.types.AsciiStrField', @name='AsciiStrField'];
Results in the following Schema XML:
<fieldType class="com.datastax.bdp.search.solr.core.types.AsciiStrField"
       name="AsciiStrField"/>
VarIntStrField
Define with the DataStax class to convert a CQL varint.
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='com.datastax.bdp.search.solr.core.types.VarIntStrField', @name='VarIntStrField'];
Results in the following schema XML:
<fieldType class="com.datastax.bdp.search.solr.core.types.VarIntStrField" name="VarIntStrField"/>
BinaryField
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='org.apache.solr.schema.BinaryField', @name='BinaryField'];
Results in the following Schema XML:
<fieldType class="org.apache.solr.schema.BinaryField" name="BinaryField"/>
BoolField
Due to SOLR-7264, setting docValues to 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.
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='org.apache.solr.schema.BoolField', @name='BoolField'];
Results in the following Schema XML:
<fieldType class="org.apache.solr.schema.BoolField" name="BoolField"/>
SimpleDateField
Define with the DataStax class to convert a CQL date field into a compatible Solr date field.
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='com.datastax.bdp.search.solr.core.types.SimpleDateField', @name='SimpleDateField'];
Results in the following Schema XML:
<fieldType class="com.datastax.bdp.search.solr.core.types.SimpleDateField" name="SimpleDateField"/>
TextField
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='org.apache.solr.schema.TextField', @name='TextField'];
To perform searches containing wildcard characters like % in TextField data, do not use the Lucene StandardAnalyzer class. Instead, define the tokenizer and filters for use in a multiterm search.
UUIDField
UUIDField is a type 1 UUID data type, which 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 a TimeUUID to a UUIDField, search for the entire UUID value, not just its time component.
ALTER SEARCH INDEX SCHEMA ON table_name 
ADD types.fieldType[@class='org.apache.solr.schema.UUIDField', @name='UUIDField'];
Results in the following Schema XML:
<fieldType class="org.apache.solr.schema.UUIDField" name="UUIDField"/>