Created
December 8, 2015 09:34
-
-
Save cadrev/94588f646099bd91093d to your computer and use it in GitHub Desktop.
cassandra test for projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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