· 9 years ago · Dec 02, 2016, 02:52 PM
1CREATE TABLE IF NOT EXISTS hosts (
2 id text,
3 cluster_id bigint,
4 access_token_id bigint,
5 hostname text,
6 updated bigint,
7 tags map<text, text>,
8 master_tags map<text, text>,
9 data map<text, text>,
10 lucene text,
11 PRIMARY KEY (id)
12) WITH caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
13 AND crc_check_chance = 0
14 AND dclocal_read_repair_chance = 0
15 AND default_time_to_live = 0
16 AND gc_grace_seconds = 0
17 AND memtable_flush_period_in_ms = 0
18 AND read_repair_chance = 0.0
19 AND speculative_retry = '99PERCENTILE';
20
21CREATE CUSTOM INDEX IF NOT EXISTS idx_hosts_lucene ON hosts (lucene) USING 'com.stratio.cassandra.lucene.Index' WITH OPTIONS = {
22 'schema' : '{
23 fields : {
24 id : {type : "string"},
25 cluster_id: {type : "integer"},
26 hostname : {type : "string"},
27 updated: {type : "integer"},
28 tags : {type : "string"},
29 master_tags : {type : "string"},
30 data_string : { type : "string", column: "data"},
31 data_float : { type : "float", column: "data"}
32 }
33 }'
34};