|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
org.ceryle.util.search.Indexer
org.ceryle.util.search.FSIndexer
public class FSIndexer
Extends the Indexer API to build an index for the provided file system (FS) directory. This wraps a lot of existing functionality into one general package, which nevertheless does not currently provide support for proprietary document formats.
Note that this class is not reentrant.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected Set |
m_directories
|
| Fields inherited from class org.ceryle.util.search.Indexer |
|---|
ANALYZER_SIMPLE, ANALYZER_STANDARD, ANALYZER_TYPE, create, m_analyzer, m_indexDirectory, m_writer, mh, mw, progress, SEARCH_INDEX_PATH, srvs, THREAD_PRIORITY |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
FSIndexer(MessageWriter msgwriter,
ProgressBar progressbar)
Constructor for a file system indexer, with a MessageWriter and optional ProgressBar. |
|
| Method Summary | |
|---|---|
File |
getIndexDirectory()
Lazily creates or returns the existing index directory, whose path is set from a property. |
void |
index(boolean createIndex)
Index the selected directories. |
protected void |
indexDocuments(org.apache.lucene.index.IndexWriter writer,
File file)
Used recursively to index a directory's documents. |
boolean |
restoreIndex()
Restore the existing index after opening a new session, returning the IndexReader if successful, null if not. |
void |
run()
Despite this being an extension of Thread, this method should not be called directly - instead, use index(boolean). |
void |
setSourceDirectories(Set directories)
Sets the Set of source directories to be indexed. |
| Methods inherited from class org.ceryle.util.search.Indexer |
|---|
closeIndex, deleteIndex, getAnalyzer, getIndexReader, getIndexWriter, getMessageHandler, getMessageWriter, getProgressBar, getStopWords, getVersion, hasProgressBar, isCreateIndex, isIndexed, mergeIndex, setCreateIndex, setIndexDirectory, setIsIndexed, setProgressBar |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Set m_directories
| Constructor Detail |
|---|
public FSIndexer(MessageWriter msgwriter,
ProgressBar progressbar)
throws SearchException
setSourceDirectories(Set) method.
msgwriter - to receive status and other messages.progressbar - (optional) to track search status.
SearchException| Method Detail |
|---|
public void setSourceDirectories(Set directories)
public void run()
index(boolean).
run in interface Runnablerun in class Indexer
protected void indexDocuments(org.apache.lucene.index.IndexWriter writer,
File file)
throws IOException,
SearchException
IOException
SearchExceptionpublic void index(boolean createIndex)
index in class Indexer
public File getIndexDirectory()
throws IOException
getIndexDirectory in class IndexerIOException - if for any reason the directory is not made available.public boolean restoreIndex()
restoreIndex in class Indexer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||