net.sf.zekr.engine.search.lucene
Class IndexCreator

java.lang.Object
  extended by net.sf.zekr.engine.search.lucene.IndexCreator

public class IndexCreator
extends java.lang.Object

This class holds some methods to do all indexing jobs associated with a special document such as Quran text. Each document which needs a kind of indexing will have some public methods inside this class.
Indexing process is done in a separate thread.

This class is immutable, hence thread-safe.

Author:
Mohsen Saboorian

Field Summary
static int ALL_USERS
           
static int CUSTOM_PATH
           
static int ME_ONLY
           
 
Constructor Summary
IndexCreator(java.lang.String[] path, IQuranText quranText, org.apache.lucene.analysis.Analyzer analyzer)
           
IndexCreator(java.lang.String[] path, IQuranText quranText, org.apache.lucene.analysis.Analyzer analyzer, org.eclipse.swt.widgets.Display display)
           
 
Method Summary
 java.lang.String getIndexDir()
           
 IndexingException getIndexingException()
           
 boolean indexQuranText()
           
 void indexSilently(java.lang.String path, java.io.PrintStream stdout)
           
 boolean isIndexingErrorOccurred()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME_ONLY

public static final int ME_ONLY
See Also:
Constant Field Values

ALL_USERS

public static final int ALL_USERS
See Also:
Constant Field Values

CUSTOM_PATH

public static final int CUSTOM_PATH
See Also:
Constant Field Values
Constructor Detail

IndexCreator

public IndexCreator(java.lang.String[] path,
                    IQuranText quranText,
                    org.apache.lucene.analysis.Analyzer analyzer,
                    org.eclipse.swt.widgets.Display display)
Parameters:
path - a two-value array of paths. The first one is for ME_ONLY and the second one is for ALL_USERS index path.
quranText - the abstract Quran text to index
analyzer - the analyzer to be used for indexing. The same analyzer should be used later for query parsing.
display - graphical display to use for showing indexing progress on (if a non-silent indexing is performed)

IndexCreator

public IndexCreator(java.lang.String[] path,
                    IQuranText quranText,
                    org.apache.lucene.analysis.Analyzer analyzer)
Parameters:
path - a two-value array of paths. The first one is for ME_ONLY and the second one is for ALL_USERS index path.
quranText - the abstract Quran text to index
analyzer - the analyzer to be used for indexing. The same analyzer should be used later for query parsing.
Method Detail

indexSilently

public void indexSilently(java.lang.String path,
                          java.io.PrintStream stdout)
                   throws IndexingException
Parameters:
path - path for creating indices in.
stdout - standard output to write progressing data to
Throws:
IndexingException - if any exception occurred during indexing process

indexQuranText

public boolean indexQuranText()
Returns:
true if indexing done successfully, false otherwise.

getIndexDir

public java.lang.String getIndexDir()

getIndexingException

public IndexingException getIndexingException()

isIndexingErrorOccurred

public boolean isIndexingErrorOccurred()