|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILuceneConnection
A connection to a Lucene index. Supports reads, writes, searches, batch updates, and truncates.
Nested Class Summary | |
---|---|
static interface |
ILuceneConnection.BatchUpdateAction
|
static interface |
ILuceneConnection.Configuration
Provide configuration for the index writers used by implementations of this interface. |
static interface |
ILuceneConnection.ReaderAction
|
static interface |
ILuceneConnection.SearcherAction
|
static interface |
ILuceneConnection.WriterAction
|
Field Summary | |
---|---|
static ILuceneConnection.Configuration |
DEFAULT_CONFIGURATION
The Bonnie default configuration. |
Method Summary | |
---|---|
void |
close()
Closes the reader and the writer. |
int |
getNumDocs()
Returns the number of documents in the index. |
boolean |
isIndexCreated()
Deprecated. since 3.2 index creation is handled by the implementation, so this method now always returns true. |
org.apache.lucene.search.IndexSearcher |
leakSearcher()
Deprecated. since 3.2 because the searcher shouldn't be leaked |
void |
optimize()
Perform an optimize on the index. |
void |
recreateIndexDirectory()
Create or recreate the underlying directory the index is contained in. |
void |
truncateIndex()
Removes all documents from the index. |
void |
withBatchUpdate(ILuceneConnection.BatchUpdateAction action)
Perform multiple writes to the index. |
void |
withDeleteAndWrites(ILuceneConnection.ReaderAction readerAction,
ILuceneConnection.WriterAction action)
Perform an Atomic delete and add. |
Object |
withReader(ILuceneConnection.ReaderAction action)
Idempotent operation. |
void |
withReaderAndDeletes(ILuceneConnection.ReaderAction action)
Delete stuff in the index. |
void |
withSearch(ILuceneConnection.SearcherAction action)
|
void |
withWriter(ILuceneConnection.WriterAction action)
Add (write) documents to the index |
Field Detail |
---|
static final ILuceneConnection.Configuration DEFAULT_CONFIGURATION
Method Detail |
---|
void withSearch(ILuceneConnection.SearcherAction action) throws LuceneException
LuceneException
Object withReader(ILuceneConnection.ReaderAction action) throws LuceneException
withReaderAndDeletes(ReaderAction)
to perform
index deletes.
LuceneException
void withReaderAndDeletes(ILuceneConnection.ReaderAction action) throws LuceneException
LuceneException
void withWriter(ILuceneConnection.WriterAction action) throws LuceneException
LuceneException
void withDeleteAndWrites(ILuceneConnection.ReaderAction readerAction, ILuceneConnection.WriterAction action) throws LuceneException
withBatchUpdate(com.atlassian.bonnie.ILuceneConnection.BatchUpdateAction)
as
it will use the batch mode configuration, speeding up the writes.
LuceneException
void withBatchUpdate(ILuceneConnection.BatchUpdateAction action)
batch
configuration
settings.
Update actions performed within a batch update won't be visible to other
readers or searchers until the batch is complete. Be aware this also
applies to actions within a batch! That is, a read operation inside a
batch will not see the changes made by earlier updates in that batch.
void optimize() throws LuceneException
LuceneException
void close() throws LuceneException
LuceneConnectionClosedException
.
LuceneException
int getNumDocs()
documents
in the index.
boolean isIndexCreated()
void recreateIndexDirectory()
org.apache.lucene.search.IndexSearcher leakSearcher()
withSearch(SearcherAction)
void truncateIndex() throws LuceneException
LuceneException
- if there was a problem removing the index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |