UDT configuration example
Use CQL commands to manage search indexes.
To create an index on a UDT, you must create the type, create a table that uses the type, and then alter the search index schema.
This example demonstrates how to configure a UDT for DSE Search.
-
In the search schema, declare the
UDTFieldclass:<fieldType class="com.datastax.bdp.search.solr.core.types.TupleField" name="UDTField"/> -
Create the UDT:
CREATE TYPE Address (street text, city text) -
Create a table with a UDT column:
CREATE TABLE Location ( id text primary key, address frozen<Address> ); -
Configure the
UDTFieldin the search index schema:<field name="address" type="UDTField" indexed="true" stored="true"/> <field name="address.street" type="text" indexed="true" stored="true"/> <field name="address.city" type="text" indexed="true" stored="true"/>