タプルとUDTのネスト
CQLリストとセットにおけるタプルとUDTのネストの例。
DSE Searchは、ネストされたタプルとUDTのクエリーをサポートしています。たとえば、CQLのリストとセット内にタプルとUDTをネストして宣言することができます。タプルとUDTをマップまたはキー内にネストすることはできません。
Addressタプルを含む型の作成
CREATE TYPE Address (street text, city text, residents set<tuple<text, text>>)
Addressタプルを含むテーブルの作成
CREATE TABLE Location (id text, address Address)
検索スキーマで、TupleFieldとネストされたTupleFieldを宣言する
<field name="address" type="TupleField" indexed="true" stored="true"/>
<field name="address.street" type="text" indexed="true" stored="true"/>
<field name="address.city" type="text" indexed="true" stored="true"/>
<field name="address.residents" type="TupleField" indexed="true" stored="true" multiValued="true"/>
<field name="address.residents.field1" type="text" indexed="true" stored="true"/>
<field name="address.residents.field2" type="text" indexed="true" stored="true"/>
residents
のネストされたタプルは、TupleField
です。ネストされた各フィールドは、ピリオドを使用してそれぞれの親のタプルまたはUDTと連結されています。