Cassandra with Stratio lucene index

1.3k views Asked by At

I have installed Data-Sax Cassandra community edition(2.2.3) on my machine and I want to use full text Search. I have downloaded the Stratio lucene index 2.2.3 and copied it to the Cassandra lib folder but when I execute the command to create index as below

   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},
        place : {type : "geo_point", latitude:"latitude",    longitude:"longitude"}
    }
}'
};

I get exception ServerError:

    ErrorMessage code=0000 [Server error] message="java.lang.RuntimeEx
   ception: java.lang.ClassNotFoundException:    
    com.stratio.cassandra.lucene.Index"

I also tried to build it using maven and update the installation , but no success. Also I copied the jar files to my JDK ext folder and tried again without any success.

Cheers, jereesh

1

There are 1 answers

1
Andrés de la Peña On

Are you sure you have copied the proper index JAR file into Cassandra's lib path?

You can download, build and patch your Cassandra installation this way:

git clone https://github.com/Stratio/cassandra-lucene-index.git
cd cassandra-lucene-index
git checkout 2.2.3.2
cd mvn clean package -Ppatch -Dcassandra_home=<PATH_TO_CASSANDRA>

Please ensure that <PATH_TO_CASSANDRA> contains the following:

CHANGES.txt     
lib
LICENSE.txt
conf
logs
NEWS.txt
data
pylib
NOTICE.txt
interface
switch_snappy
bin
javadoc
tools

Otherwise, you can download DSC community 2.2.3 from http://downloads.datastax.com/community/dsc-cassandra-2.2.3-bin.tar.gz

I hope it helps.