net.sf.zekr.engine.search.lucene
Class LuceneIndexManager
java.lang.Object
net.sf.zekr.engine.search.lucene.LuceneIndexManager
public class LuceneIndexManager
- extends java.lang.Object
This class manages Lucene indices for Quran and translations.
- Author:
- Mohsen Saboorian
Constructor Summary |
LuceneIndexManager(org.apache.commons.configuration.PropertiesConfiguration props)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LuceneIndexManager
public LuceneIndexManager(org.apache.commons.configuration.PropertiesConfiguration props)
getQuranIndex
public ZekrIndexReader getQuranIndex()
throws IndexingException
- This method first checks if the Quran is previously indexed (first in user home and then in installation
directory). If not, it will try to index it, asking user where to index. If this is already indexed,
returns the directory where Quran indices are.
- Returns:
- directory of the Quran index if indexing was successful (or found index somewhere),
null
otherwise
- Throws:
IndexingException
- if indexing or opening existing index failed
getIndex
public ZekrIndexReader getIndex(IQuranText quranText)
throws IndexingException
- Throws:
IndexingException
getIndex
public ZekrIndexReader getIndex(TranslationData td)
throws IndexingException
- Throws:
IndexingException
createQuranIndex
public void createQuranIndex(IQuranText quranText,
int mode,
java.lang.String path,
java.io.PrintStream stdout)
throws IndexingException
- This method silently indexes a Quran text. It should only be used for command line indexing. This method
sets index.[quran/trans].path[.trans id] property to the index directory, if indexing finished
without throwing
IndexingException
.
- Parameters:
mode
- can be IndexCreator.ME_ONLY
or IndexCreator.ALL_USERS
.path
- path for creating indices in. Used iff mode is equal to IndexCreator.CUSTOM_PATH
stdout
- standard output to write progressing data to
- Throws:
IndexingException
- if any error occurred during indexing process.