Skip to content

DDTH/cassdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is no longer active. See its descendant if you are looking for Cassandra implementation of Lucene's Directory

cassdir

Cassandra implementation of Lucene Directory.

By Thanh Ba Nguyen (btnguyen2k (at) gmail.com)

Project home: https://github.com/DDTH/cassdir

Features

  • Store Lucene's index in Cassandra.
  • Performance enhancement with caching support.
  • Support fine-tuning Cassandra consistency level per operation (read/write file data, lock, remove file, etc).

Installation

Latest release version: 0.1.1. See RELEASE-NOTES.md.

Maven dependency:

<dependency>
	<groupId>com.github.ddth</groupId>
	<artifactId>cassdir</artifactId>
	<version>0.1.1</version>
</dependency>

Related projects/libs

Usage

Cassandra column family schema (as CQL): see dbschema/cassdir.cql.

Create a CassandraDirectory instance:

String cassHostsAndPorts = "localhost:9042,host2:port2,host3:port3";
CassandraDirectory DIR = new CassandraDirectory(cassHostsAndPorts, cassUser, cassPassword, cassKeySpace);
DIR.init();

Index documents with IndexWriter:

Analyzer analyzer = new StandardAnalyzer();
IndexWriterConfig iwc = new IndexWriterConfig(analyzer);
iwc.setOpenMode(OpenMode.CREATE_OR_APPEND);
IndexWriter iw = new IndexWriter(DIR, iwc);

// add/update documents
// ...

iw.commit();
iw.close();

Or, search documents with IndexSearcher:

IndexReader ir = DirectoryReader.open(DIR);
IndexSearcher is = new IndexSearcher(ir);

// search documents
// ...

ir.close();

Call CassandraDirectory.destroy() when done.

Examples: see src/test/java.

License

See LICENSE.txt for details. Copyright (c) 2015 Thanh Ba Nguyen.

Third party libraries are distributed under their own license(s).

About

Cassandra implementation of Lucene Directory

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages