Skip to content

DDTH/redir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

redir

Redis implementation of Lucene Directory.

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

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

Features

Installation

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

Maven dependency:

<dependency>
	<groupId>com.github.ddth</groupId>
	<artifactId>redir</artifactId>
	<version>0.1.2</version>
</dependency>

Related projects/libs

  • jedis: the underlying lib to access Redis.

Usage

Create a RedisDirectory instance:

RedisDirectory DIR = new RedisDirectory(redisHost, redisPort, redisPassword);
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 RedisDirectory.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

Redis implementation of Lucene Directory

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages