|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.bonnie.index.TempIndexWriter
public class TempIndexWriter
Index writer that is able to write to one or more temporary indices. This writer is typically used to:
| Nested Class Summary | |
|---|---|
protected class |
TempIndexWriter.WriterData
|
| Field Summary | |
|---|---|
protected static org.apache.log4j.Category |
log
|
| Constructor Summary | |
|---|---|
TempIndexWriter(org.apache.lucene.analysis.Analyzer analyzerForIndexing,
java.lang.String tmpDir)
|
|
TempIndexWriter(org.apache.lucene.analysis.Analyzer analyzerForIndexing,
java.lang.String tmpDir,
ILuceneConnection.Configuration configuration)
Constructs a temp index writer. |
|
| Method Summary | |
|---|---|
void |
addDocument(java.lang.String key,
org.apache.lucene.document.Document doc)
Add a document to an index. |
void |
close(java.lang.String prefix)
Delete the respective temp indices. |
void |
closeAll()
Delete the respective temp indices. |
protected boolean |
delete(java.io.File directory)
|
java.lang.String |
getTmpDir()
|
void |
merge(org.apache.lucene.index.IndexWriter writer)
Close all temporary writers, and merge all temporary indices to the writer provided. |
void |
merge(java.lang.String prefix,
org.apache.lucene.index.IndexWriter writer)
Close relevant temporary writers, and merge temporary indices identified by keys which start with the provided prefix to the writer provided. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.log4j.Category log
| Constructor Detail |
|---|
public TempIndexWriter(org.apache.lucene.analysis.Analyzer analyzerForIndexing,
java.lang.String tmpDir)
public TempIndexWriter(org.apache.lucene.analysis.Analyzer analyzerForIndexing,
java.lang.String tmpDir,
ILuceneConnection.Configuration configuration)
analyzerForIndexing - analyzer used by IndexWriters created and managed by this temp index writer. Required parameter.tmpDir - directory where temporary directories will be created in. Required parameter.configuration - allows configuration of the IndexWriters created and managed
by this temp index writer. Only the batch settings will be used (as the assumption here is that
TempIndexWriters will be used for batch indexing purposes only).
java.lang.IllegalArgumentException - if analyzerForIndexing, tmpDir or configuration are null| Method Detail |
|---|
public void addDocument(java.lang.String key,
org.apache.lucene.document.Document doc)
throws java.io.IOException
key - key representing which index to write to. A new writer will be created if no writer exists for the key.doc - document to add
java.io.IOException
public void close(java.lang.String prefix)
throws java.io.IOException
prefix -
java.io.IOException
public void closeAll()
throws java.io.IOException
java.io.IOException
public void merge(org.apache.lucene.index.IndexWriter writer)
throws java.io.IOException
writer -
java.io.IOException
public void merge(java.lang.String prefix,
org.apache.lucene.index.IndexWriter writer)
throws java.io.IOException
prefix - key prefixwriter -
java.io.IOExceptionprotected final boolean delete(java.io.File directory)
public java.lang.String getTmpDir()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||