Skip to content

Instantly share code, notes, and snippets.

@cadrev
Created December 8, 2015 09:34
Show Gist options
  • Save cadrev/94588f646099bd91093d to your computer and use it in GitHub Desktop.
Save cadrev/94588f646099bd91093d to your computer and use it in GitHub Desktop.
cassandra test for projects
CREATE KEYSPACE demo
WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1};
USE demo;
CREATE TABLE tweets (
id bigint PRIMARY KEY,
user TEXT,
body TEXT,
time TIMESTAMP,
lucene TEXT
);
CREATE CUSTOM INDEX tweets_index ON tweets (lucene)
USING 'com.stratio.cassandra.lucene.Index'
WITH OPTIONS = {
'refresh_seconds' : '1',
'schema' : '{
fields : {
id : {type : "integer"},
user : {type : "string"},
body : {type : "text", analyzer : "english"},
time : {type : "date", pattern : "yyyy/MM/dd", sorted : true}
}
}'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment