Indexing tuples and UDTs fields
This page provides guidelines for advanced data types, including tuples and user-defined types (UDT).
Considerations
-
The tuple data type holds fixed-length sets of typed positional fields. Use a tuple as an alternative to a UDT.
-
A UDT facilitates handling multiple fields of related information in a table. UDTs are a specialization of tuples. All examples and documentation references to tuples apply to both tuples and UDTs.
Simplify applications that require multiple tables by using UDTs to represent the related fields of information, instead of storing the information in a separate table.
-
Tuples and UDTs are read and written as a single unit of information. Consider performance and memory impact when working with tuples and UDTs. Subfields are managed as the full tuple or UDT, and are not handled individually.
-
DSE Search does not support the following:
-
Tuples and UDTs that are used inside primary key declarations.
-
Tuples and UDTs that are used as CQL map values. Instead, use a workaround to simulate a map-like data model.
-
Dynamic fields as tuples or UDTs.
-
Tuple/UDT subfield sorting and faceting.
-
Usage
To add CQL tuple and user-defined type (UDT) columns to an existing search index, do the following:
-
Define a field for the table column using the DataStax Tuple class (
com.datastax.bdp.search.solr.core.types.TupleField). -
Define a field for each value in the CQL tuple or UDT column using the corresponding Apache Solr™ field type.
The schema field name is
column_name.field<N>where the <column_name> matches the CQL column and <N> is the field position starting at 1.