## helma.Search.Document

    Object
       |
       +--helma.Search.Document

Instances of this class represent a single index document. This class provides various methods for adding content to such documents.
Defined in Search.js

SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods

Constructor Summary
`helma.Search.Document(<org.apache.lucene.document.Document> document)` Creates a new instance of helma.Search.Document.

Methods Summary
`void` | `addField(<String> name, <String> value, <Object> param)` Adds a field to this document.
`Number` | `getBoost()` Returns the boost factor of a document.
`Object` | `getDateField(<String> name)` Returns the value of a single document field converted into a Date object.
`org.apache.lucene.document.Document` | `getDocument()` Returns the wrapped Lucene Document object
`Object` | `getField(<String> name)` Returns a single document field containing a value other than a date object, for which you should use getDateField().
`Array` | `getFields()` Returns the fields of a document object.
`void` | `setBoost(<Number> boost)` Sets the boost factor of a document.

Constructor Detail

### helma.Search.Document

    helma.Search.Document(<org.apache.lucene.document.Document> document)

Creates a new instance of helma.Search.Document.

Parameters:

`document` - Optional Lucene Document object that should be wrapped by this Document instance.

Method Detail

### addField

    void addField(<String> name, <String> value, <Object> param)

Adds a field to this document.

Parameters:

`name` - The name of the field

`value` - The value of the field

`param` - Optional parameter object containing the following properties:

- `store` (Boolean) defaults to true
- `index` (Boolean) defaults to true
- `tokenize` (Boolean) defaults to true

### getBoost

    Number getBoost()

Returns the boost factor of a document.

Returns:

The boost factor of a document

### getDateField

    Object getDateField(<String> name)

Returns the value of a single document field converted into a Date object. For retrieving a value without this conversion see getField().

Parameters:

`name` - The name of the field in this document object.

Returns:

An object containing the following properties:

- `name` (String) The name of the field
- `boost` (Int) The boost factor
- `indexed` (Boolean) True if the field is indexed, false otherwise
- `stored` (Boolean) True if the field is stored, false otherwise
- `tokenized` (Boolean) True if the field is tokenized, false otherwise
- `value` (String) The value of the field as Date

See:

- getField()

### getDocument

    org.apache.lucene.document.Document getDocument()

Returns the wrapped Lucene Document object

Returns:

The wrapped Document object

### getField

    Object getField(<String> name)

Returns a single document field containing a value other than a date object, for which you should use getDateField().

Parameters:

`name` - The name of the field in this document object.

Returns:

An object containing the following properties:

- `name` (String) The name of the field
- `boost` (Int) The boost factor
- `indexed` (Boolean) True if the field is indexed, false otherwise
- `stored` (Boolean) True if the field is stored, false otherwise
- `tokenized` (Boolean) True if the field is tokenized, false otherwise
- `value` (String) The value of the field

### getFields

    Array getFields()

Returns the fields of a document object.

Returns:

An array containing all fields in this document object.

### setBoost

    void setBoost(<Number> boost)

Sets the boost factor of a document.

Parameters:

`boost` - The boost factor of the document

SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods

Documentation generated by JSDoc on Thu Apr 5 01:59:00 2007