Fields and methods of the jala.IndexManager class.
Constructs a new IndexManager object.
parameters
String | name | The name of the index, which is the name of the directory the index already resides or will be created in. |
helma.File | dir | The base directory where this index's directory is already existing or will be created in. |
String | lang | The language of the documents in this index. This leads to the proper Lucene analyzer being used for indexing documents. |
methods
- getIndex()
- setStatus(s)
- getQueue()
- getName()
- setIdFieldname(name)
- start()
- stop()
- log(level, msg)
- add(doc)
- remove(id)
- optimize()
see
Creates a new Job instance.
parameters
Number | id | The Id of the job |
Number | type | The type of job, which can be either jala.IndexManager.Job.ADD, jala.IndexManager.Job.REMOVE or jala.IndexManager.Job.OPTIMIZE. |
Object | data | The data needed to process the job. |
properties
- Number type
- Number errors
- Date createtime
see
Constant defining the maximum number of tries to add/remove
an object to/from the underlying index.
Constant defining normal mode of this index manager.
Constant defining rebuilding mode of this index manager.
The type of the job
The data needed to process this job. For adding jobs this property
must contain the {@link helma.Search.Document} instance to add to
the index. For removal job this property must contain the unique identifier
of the document that should be removed from the index. For optimizing
jobs this property is null.
An internal error counter which is increased whenever processing
the job failed.
see
The date and time at which this job was created.
Constant defining an add job
Constant defining a removal job
Constant defining an optimizing job
Methods
Returns the underlying index.
returns
The index this queue is working on. |
Returns the status of this manager.
returns
The status of this index manager. |
see
Modifies the status of this manager, which has implications
on how index modifying jobs are handled. If the status
is {@link #REBUILDING}, all jobs are queued until the status
is set back to {@link #NORMAL}.
parameters
Number | s | The new status of this manager. |
see
Returns the name of the index manger, which
is equal to the name of the underlying index
returns
The name of the index manager |
Returns the name of the field containing the unique identifier
of document objects in the index wrapped by this IndexManager.
Defaults to "id".
returns
The name of the id field in the index |
see
Sets the name of the field containing the unique identifier
of document objects in the index wrapped by this IndexManager.
parameters
name |
see
Returns true if the underlying index is currently optimized.
returns
True in case the index is optimized, false otherwise. |
Returns true if the underlying index is currently rebuilding.
returns
True in case the index is rebuilding, false otherwise. |
Starts the IndexManager worker thread that processes the job queue
Stops this IndexManager instance
Returns true if this IndexManager instance is running
returns
True if this IndexManager instance is running, false otherwise. |
Helper function that prefixes every log message with
the name of the IndexManager.
parameters
String | level | An optional logging level. Accepted values |
String | msg | The log message are "debug", "info", "warn" and "error". |
Queues the document object passed as argument for addition to the underlying
index. This includes that all existing documents with the same identifier will
be removed before the object passed as argument is added.
parameters
helma.Search.Document | doc | The document object that should be added to the underlying index. |
returns
True if the job was added successfully to the internal queue, false otherwise. |
see
Queues the removal of all index documents whose identifier value ("id" by default)
matches the number passed as argument.
parameters
Number | id | The identifier value |
returns
True if the removal job was added successfully to the queue, false otherwise. |
Queues the optimization of the underlying index.
returns
True if the optimizing job was added, false otherwise, which means that there is already an optimizing job waiting in the queue. |