new Cause(qualityopt, causePropertiesopt)
Creates a new cause
Name | Type | Attributes | Description |
---|---|---|---|
quality | number | <optional> | Quality of the cause |
causeProperties | object | <optional> | Properties of the cause |
If the quality is not between 0 and 1
Provides additional details about a hit returned by a query
Methods
properties()
Returns all properties (restricted to those that can be converted to objects)
- Since
- 5.3.0
property(name)
Returns the value of the named property, or undefined if the property does not exist
Name | Type | Description |
---|---|---|
name | string |
If the name is not a string
If the value of the property cannot be converted to an object
quality() → {number}
Returns the quality of the cause, a number between 0 (worst quality) and 1 (best quality)
- Type:
- number
setProperties(properties)
Set the properties of the cause
Name | Type | Description |
---|---|---|
properties | object |
If the value is not a valid property value
setProperty(name, value)
Set the value of the named property
Name | Type | Description |
---|---|---|
name | string | |
value |
If the name is not a string
If the value is not a valid property value
setQuality(quality)
Set the quality, a number between 0 and 1
Name | Type | Description |
---|---|---|
quality | number |
If the quality is not between 0 and 1
setType(type)
Set the type
Name | Type | Description |
---|---|---|
type | string |
If this is a system-defined cause
- Type
- RangeError
type() → {string}
Returns the type of the cause, e.g. 'semantic'
- Type:
- string