Detailed reference of prototypes, properties and methods available in the
Javascript environment of your Helma web applications.

Fields and methods of the jala.IndexManager class.
jala IndexManager(name, dir, lang)
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()

- getStatus()

- setStatus(s)

- getQueue()

- getName()

- getIdFieldname()

- setIdFieldname(name)

- hasOptimizingJob()

- isRebuilding()

- start()

- stop()

- isRunning()

- log(level, msg)

- add(doc)

- remove(id)

- optimize()

see

helma.Search.createIndex

jala IndexManager.Job(id, type, data)
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

- callback

- Number errors

- Date createtime

see

jala.IndexManager.Job

Number jala. IndexManager.MAXTRIES
Constant defining the maximum number of tries to add/remove an object to/from the underlying index.
Number jala. IndexManager.NORMAL
Constant defining normal mode of this index manager.
Number jala. IndexManager.REBUILDING
Constant defining rebuilding mode of this index manager.
Number jala.IndexManager.Job. type
The type of the job
jala.IndexManager.Job. callback
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.
Number jala.IndexManager.Job. errors
An internal error counter which is increased whenever processing the job failed.
see

jala.IndexManager.MAXTRIES

Date jala.IndexManager.Job. createtime
The date and time at which this job was created.
Number jala. IndexManager.Job.ADD
Constant defining an add job
Number jala. IndexManager.Job.REMOVE
Constant defining a removal job
Number jala. IndexManager.Job.OPTIMIZE
Constant defining an optimizing job
Methods
jala.IndexManager. getIndex()
Returns the underlying index.
returns

| The index this queue is working on.

jala.IndexManager. getStatus()
Returns the status of this manager.
returns

| The status of this index manager.

see

jala.IndexManager.NORMAL
jala.IndexManager.REBUILDING

jala.IndexManager. setStatus(s)
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

jala.IndexManager.NORMAL
jala.IndexManager.REBUILDING

jala.IndexManager. getQueue()
Returns the queue this index manager is using.
returns

| The queue.

jala.IndexManager. getName()
Returns the name of the index manger, which is equal to the name of the underlying index
returns

| The name of the index manager

jala.IndexManager. getIdFieldname()
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

jala.IndexManager.setIdFieldname

jala.IndexManager. setIdFieldname(name)
Sets the name of the field containing the unique identifier of document objects in the index wrapped by this IndexManager.
parameters

| name |

see

jala.IndexManager.getIdFieldname

jala.IndexManager. hasOptimizingJob()
Returns true if the underlying index is currently optimized.
returns

| True in case the index is optimized, false otherwise.

jala.IndexManager. isRebuilding()
Returns true if the underlying index is currently rebuilding.
returns

| True in case the index is rebuilding, false otherwise.

jala.IndexManager. start()
Starts the IndexManager worker thread that processes the job queue
jala.IndexManager. stop()
Stops this IndexManager instance
jala.IndexManager. isRunning()
Returns true if this IndexManager instance is running
returns

| True if this IndexManager instance is running, false otherwise.

jala.IndexManager. log(level, msg)
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".

jala.IndexManager. add(doc)
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

helma.Search.Document

jala.IndexManager. remove(id)
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.

jala.IndexManager. optimize()
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.

Tue, 25 Nov 2008 16:50:11 GMT.

### core framework

- global
- app (application)
- req (request)
- res (response)
- session
- path
- root
- HopObject
- User
- File
- FtpClient
- Image
- Mail
- Remote
- Xml
- DatabaseObject
- MimePart
- Skin
- Object

### optional modules

- Array extensions
- Date extensions
- Number extensions
- Object extensions
- String extensions
- HopObject extensions
- global macros
- macro filters
- JSON methods
- helma.Aspects
- helma.Chart
- helma.Color
- helma.Database
- helma.File
- helma.Ftp
- helma.Group
- helma.Html
- helma.Http
- helma.Image
- helma.Mail
- helma.Search
- helma.Skin
- helma.Ssh
- helma.Url
- helma.Zip
- jala.BitTorrent
- jala.Captcha
- jala.Date
- jala.db
- jala.DnsClient
- jala.Form
- jala.History
- jala HopObject extensions
- jala.HtmlDocument
- jala.I18n
- jala.ImageFilter
- jala.IndexManager
- jala.ListRenderer
- jala.Mp3
- jala.PodcastWriter
- jala.RemoteContent
- jala.Rss20Writer
- jala.Utilities
- jala.XmlRpcRequest
- jala.XmlWriter

### java libraries

- browse docjar