|
Jala 1.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--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 |
<static> <final> Number MAXTRIES
<static> <final> Number NORMAL
<static> <final> Number OPTIMIZE_INTERVAL
<static> <final> Number REBUILDING
| Constructor Detail |
jala.IndexManager(<String> name, <helma.File> dir, <String> lang)
name - The name of the index, which is the name of the directory the index already resides or will be created in.
dir - The base directory where this index's directory is already existing or will be created in.
lang - The language of the documents in this index. This leads to the proper Lucene analyzer being used for indexing documents.
| Method Detail |
void add(<helma.Search.Document> doc, <Boolean> force)
doc - The document object that should be added to the underlying index.
force - (optional) If true the object will be added instantly to the index without any check if the index is locked or not, so use this option with caution. Normally this option should never be set manually.
Number getCurrentIndexVersion()
helma.Search.Index getIndex()
String getName()
java.util.LinkedList getQueue()
Array getSegmentInfos()
Number getStatus()
Number getVersion()
Boolean hasOptimizingJob()
Boolean hasWorker()
Boolean isRebuilding()
Boolean needsOptimize()
void optimize(<Boolean> force)
force - If true the index is optimized immediately, without any check whether the index is locked or not, so use this option with caution.
void remove(<Number> id, <Boolean> force)
id - The Id of the document object(s) to remove from the underlying index.
force - (optional) If true the removal is done instantly. In this case no checking is done if the index is locked, so use this option with caution as it might lead to index corruption.
void setStatus(<Number> s)
s - The new status of this manager.
void updateVersion()
|
Jala 1.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||