okapi.util
Class OkapiSearchUtils.SearchIndexer

java.lang.Object
  extended by java.lang.Thread
      extended by okapi.util.OkapiSearchUtils.SearchIndexer
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
OkapiSearchUtils

public static class OkapiSearchUtils.SearchIndexer
extends java.lang.Thread

class SearchIndexer Class to perform indexing. To recreate the index: - set the index directory with OkapiSearchUtils.setIndexPathsFromContext() or OkapiSearchUtils.setIndexPaths() - get a SearchIndexer with OkapiSearchUtils.getSearchIndexer() - set the root nexus from which indexing starts with setRootNexus() - run the indexer with start() The SearchIndexer is eventually released by run().


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static int doIndex(java.lang.String searchIndexPath, OkapiNexus nexus, java.util.Vector errv)
          doIndex Index content starting from the specified nexus (should be the root nexus).
 void run()
          run Performs indexing, if possible.
 void setRootNexus(OkapiNexus nexus)
          setRootNexus Sets root nexus for subsequent run() of this object.
 
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
 

Method Detail

setRootNexus

public void setRootNexus(OkapiNexus nexus)
setRootNexus Sets root nexus for subsequent run() of this object. Needs to be called before thread is started.

Parameters:
nexus - root nexus for indexing

run

public void run()
run Performs indexing, if possible. Called through start(). The index directory and root nexus should be set before calling start().

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

doIndex

public static int doIndex(java.lang.String searchIndexPath,
                          OkapiNexus nexus,
                          java.util.Vector errv)
doIndex Index content starting from the specified nexus (should be the root nexus).

Parameters:
searchIndexPath - The directory where the index should be created.
nexus - The nexus at which to start the indexing process.
errv - A vector in which error messages (Strings) are returned.
Returns:
the number of arcs that were indexed


Copyright ? 2001-2009 MIT. All Rights Reserved.