lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maik Schreiber <>
Subject Fwd: Contribution: LuceneIndexAccessor
Date Tue, 17 May 2005 15:59:00 GMT
-------- Original Message --------
Subject: Contribution: LuceneIndexAccessor
Date: Mon, 16 May 2005 18:11:23 +0200
From: Maik Schreiber <>


My company would like to make the following contribution to Lucene (in
sandbox?) licensed under the Apache License, Version 2.0.

Background: While doing project work on a web-based search engine we have
developed a component called LuceneIndexAccessor. This component provides a
high-level index access interface, that is, it synchronizes read/write
access to a Lucene index. You no longer need to worry about concurrently
opening readers/writers/searchers. The component also does caching where
applicable. Further, it makes sure that all Searchers get closed whenever
you have added a document to the index.

You can download the source here:

Using LuceneIndexAccessor is incredibly simple:

Directory directory = ...
Analyzer analyzer = ...

// somewhere near program start
IIndexAccessProvider accessProvider =
	new IndexAccessProvider(directory, analyzer);
ILuceneIndexAccessor accessor = new LuceneIndexAccessor(accessProvider);;

IndexWriter writer = null;
try {
	writer = accessor.getWriter();

	// use writer...
} catch (IOException e) {
	// ...
} finally {

// somewhere near program exit

(Opening IndexReaders or Searchers follows the same use pattern.)

Right now, the source compiles against a CVS version of Lucene. Also, it
uses Log4J for logging. We're happy with changing that if need arises.

Maik Schreiber   *

GPG public key:
Key fingerprint: CF19 AFCE 6E3D 5443 9599 18B5 5640 1F11 D713

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message