|
Jala 1.3 | ||||||||
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 and optimizing the underlying index.
All methods generate jobs that are put into an internal queue which is
processed asynchronously by a separate worker thread. This means all calls
to add(), remove() and optimize() will return immediately, but the changes to
the index will be done within a short delay. Please keep in mind to change the
status of this IndexManager instance to REBUILDING before starting to rebuild
the index, as this ensures that all add/remove/optimize jobs will stay in the
queue and will only be processed after switching the status back to NORMAL.
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 |
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 | |
Boolean
|
add(<helma.Search.Document> doc)
Queues the document object passed as argument for addition to the underlying index. |
void
|
log()
Helper function that prefixes every log message with the name of the IndexManager. |
Boolean
|
optimize()
Queues the optimization of the underlying index. |
Boolean
|
remove(<Number> id)
Queues the removal of all index documents whose identifier value ("id" by default) matches the number passed as argument. |
Field Detail |
<static> <final> Number MAXTRIES
<static> <final> Number NORMAL
<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 |
Boolean add(<helma.Search.Document> doc)
doc
- The document object that should be added to the underlying index.
void log()
level
- An optional logging level. Accepted values
msg
- The log message are "debug", "info", "warn" and "error".
Boolean optimize()
Boolean remove(<Number> id)
id
- The identifier value
|
Jala 1.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |