Criando uma database + seed
CREATE KEYSPACE testdb WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};CREATE TABLE post(id uuid, moment timestamp, body text, author varchar, PRIMARY KEY (id));Inserts
INSERT INTO post (id, moment, body, author) VALUES (uuid(), '2021-02-26T10:00:00Z', 'Bom dia!', 'Bob');
INSERT INTO post (id, moment, body, author) VALUES (uuid(), '2021-02-27T10:00:00Z', 'Partiu viagem', 'Maria');
INSERT INTO post (id, moment, body, author) VALUES (uuid(), '2021-02-27T10:00:00Z', 'Que dia bonito!', 'Maria');Selects
SELECT * FROM post;
SELECT * FROM post WHERE author = 'Maria' ALLOW FILTERING;CREATE CUSTOM INDEX body_idx ON post (body) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'CONTAINS', 'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer','case_sensitive': 'false'};AnteriorAcessando o Cassandra via terminal cqlshPróximoCódigos (properties, CassandraConfig, SeedConfig)
Atualizado