|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectmaiolum.xml.index.BibleModuleIndexer
Used to perform bible documents reindexing using Lucene. This class should be used to start reindexing single document (represented in the filesystem or by DOM) or all BibleModules located in ModuleManager.
| Field Summary | |
private java.lang.String |
baseIndexPath
Base directory, where index is located |
private BibleContentHandler |
contentHandler
Used to create Document objects from Bible XML documents. |
private Edition |
defaultEdition
Default Edition for indexed modules. |
private org.apache.lucene.index.IndexWriter |
indexWriter
IndexWriter to store Lucene Document objects, that were parsed from the bible XML file. |
private static org.apache.log4j.Logger |
logger
|
private org.xml.sax.XMLReader |
parser
XML parser used to parse given XML document. |
| Constructor Summary | |
BibleModuleIndexer()
Default constructor. |
|
BibleModuleIndexer(java.lang.String baseIndexPath)
Instantiates new BibleModuleIndexer using parameter for base location of index. |
|
| Method Summary | |
java.lang.String |
getBaseIndexPath()
Sets base directory, where the index will be located |
Edition |
getDefaultEdition()
Get default Edition for the parsed XML bible document |
void |
mergeIndices(java.io.File indicesParentDir,
java.io.File mainIndexDir)
Merges all indices located in the subdirectories into one larger. |
void |
reindex(org.xml.sax.InputSource source,
java.io.File indexDirectory)
Reindexes bible document in the DOM InputSource representation to given directory. |
void |
reindex(ModuleManager m)
Reindexes all BibleModules in the ModuleManager to base index directory. |
void |
reindex(java.lang.String systemID,
java.io.File indexDirectory)
Reindexes bible document identified by system ID to given directory. |
void |
reindex(XMLBibleModule module)
Reindexes given XML BibleModule to base index directory. |
void |
retrieveVerse(org.apache.lucene.document.Document doc)
Observer of the BibleContentHandler. |
void |
setBaseIndexPath(java.lang.String value)
Returns base directory, where index is located |
void |
setDefaultEdition(Edition defaultEdition)
Set default Edition for the parsed XML bible document |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static org.apache.log4j.Logger logger
private java.lang.String baseIndexPath
private Edition defaultEdition
private BibleContentHandler contentHandler
private org.xml.sax.XMLReader parser
private org.apache.lucene.index.IndexWriter indexWriter
| Constructor Detail |
public BibleModuleIndexer()
public BibleModuleIndexer(java.lang.String baseIndexPath)
| Method Detail |
public void reindex(java.lang.String systemID,
java.io.File indexDirectory)
throws java.io.IOException,
ParseException
systemID - specifies location (typically in the filesystem) of
document to be indexed.indexDirectory - fully qualified path to the directory, where will be the index
created
java.io.IOException - when I/O problem is encountered while creating index
ParseException - when source document cannot be properly parsed
public void reindex(org.xml.sax.InputSource source,
java.io.File indexDirectory)
throws java.io.IOException,
ParseException
source - represents document DOM representationindexDirectory - fully qualified path to the directory, where will be the index
created
java.io.IOException - when I/O problem is encountered while creating index
ParseException - when source document cannot be properly parsed
public void reindex(ModuleManager m)
throws java.io.IOException,
ParseException
setBaseIndexPath(String) to set the target directory for index.
Each module in the ModuleManager will be indexed into separate index,
while this indexes are located in the subdirectories of the base
index directory. Names of these subdirectories are set according
to hash value of BibleModule URI (using Object.hashCode()).
You can merge multiple indices into one larger using
mergeIndices(File, File) method.
java.io.IOException
ParseException
public void reindex(XMLBibleModule module)
throws java.io.IOException,
ParseException
setBaseIndexPath(String) to set the target directory for index.
The module will be indexed subdirectory of base directory, the
name is set according to hash value of BibleModule URI
(using Object.hashCode()).
You can merge multiple indices into one larger using
mergeIndices(File, File) method.
java.io.IOException
ParseException
public void mergeIndices(java.io.File indicesParentDir,
java.io.File mainIndexDir)
throws java.io.IOException
indicesParentDir - is the directory, which contains multiple
subdirectories -- each of these subdirectories should hold one
index.mainIndexDir - represents target directory into which will the partial
indices be merged.
java.io.IOExceptionpublic void retrieveVerse(org.apache.lucene.document.Document doc)
retrieveVerse in interface VerseDocumentObserverpublic java.lang.String getBaseIndexPath()
public void setBaseIndexPath(java.lang.String value)
public Edition getDefaultEdition()
public void setDefaultEdition(Edition defaultEdition)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||