Jala 1.2

Class jala.IndexManager

Object
   |
   +--jala.IndexManager

class jala.IndexManager


This class basically sits on top of a helma.Search.Index instance and provides methods for adding, removing, optimizing and rebuilding the underlying index. All methods except rebuilding are executed asynchronously using an internal queue that contains jobs created for each call of add/remove/optimize. Rebuilding is somehow different as it puts this manager into rebuilding mode where all following calls of add/remove/optimize are queued, but the queue is not flushed until rebuilding has finished. This ensures that objects that have been modified during a rebuilding process are re-indexed properly afterwards.
Defined in IndexManager.js

See:


Nested Class Summary
<static class> jala.IndexManager.Job
 
Field Summary
<static>  <final> Number MAXTRIES
          Constant defining the maximum number of tries to add/remove an object to/from the underlying index.
<static>  <final> Number NORMAL
          Constant defining normal mode of this index manager.
<static>  <final> Number OPTIMIZE_INTERVAL
          Constant defining the number of changes in the underlying index before it should be optimized.
<static>  <final> Number REBUILDING
          Constant defining rebuilding mode of this index manager.
 
Constructor Summary
jala.IndexManager (<String> name, <helma.File> dir, <String> lang)
            Constructs a new IndexManager object.
 
Method Summary
 void add(<helma.Search.Document> doc, <Boolean> force)
           Adds a document object to the underlying index.
 Number getCurrentIndexVersion()
           Returns the version number of the underlying index.
 helma.Search.Index getIndex()
           Returns the underlying index.
 String getName()
           Returns the name of the index manger, which is equal to the name of the underlying index
 java.util.LinkedList getQueue()
           Returns the queue this index manager is using.
 Array getSegmentInfos()
           Returns an Array containing objects, where each one contains information about an index segment in two properties: "name" is the file name of the segment, and "docCount" contains the number of documents in this segment.
 Number getStatus()
           Returns the status of this manager.
 Number getVersion()
           Returns the current version of this index manager
 Boolean hasOptimizingJob()
           Returns true if the underlying index is currently optimized.
 Boolean hasWorker()
           Returns true if a worker has been initialized and it's still alive.
 Boolean isRebuilding()
           Returns true if the underlying index is currently rebuilding.
 Boolean needsOptimize()
           Returns true if the index should be optimized.
 void optimize(<Boolean> force)
           Optimizes the underlying index.
 void remove(<Number> id, <Boolean> force)
           Removes all entries with the Id passed as argument from the underlying index.
 void setStatus(<Number> s)
           Modifies the status of this manager, which has implications on how index modifying jobs are handled.
 void updateVersion()
           Updates the internal version property of this index manager to the current version of the underlying index.

Field Detail

MAXTRIES

<static> <final> Number MAXTRIES

NORMAL

<static> <final> Number NORMAL

OPTIMIZE_INTERVAL

<static> <final> Number OPTIMIZE_INTERVAL

REBUILDING

<static> <final> Number REBUILDING

Constructor Detail

jala.IndexManager

jala.IndexManager(<String> name, <helma.File> dir, <String> lang)

Method Detail

add

void add(<helma.Search.Document> doc, <Boolean> force)

getCurrentIndexVersion

Number getCurrentIndexVersion()

getIndex

helma.Search.Index getIndex()

getName

String getName()

getQueue

java.util.LinkedList getQueue()

getSegmentInfos

Array getSegmentInfos()

getStatus

Number getStatus()

getVersion

Number getVersion()

hasOptimizingJob

Boolean hasOptimizingJob()

hasWorker

Boolean hasWorker()

isRebuilding

Boolean isRebuilding()

needsOptimize

Boolean needsOptimize()

optimize

void optimize(<Boolean> force)

remove

void remove(<Number> id, <Boolean> force)

setStatus

void setStatus(<Number> s)

updateVersion

void updateVersion()

Jala 1.2

Documentation generated by JSDoc on Tue May 29 10:26:15 2007