|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Resource
A Resource holds a list of meta data properties. The Resource is the basic data that is saved in Compass. Compass provides object to Resource mapping as well in the CompassSession object.
| Method Summary | |
|---|---|
Resource |
addProperty(Property property)
Add a property to the resource. |
Resource |
addProperty(String name,
Object value)
Adds a property to the resource based on resource mapping definitions. |
Resource |
addProperty(String name,
Reader value)
Adds a property to the resource based on resource mapping definitions. |
void |
copy(Resource resource)
Copies the content of the give Resource into the current one |
String |
getAlias()
Returns the mapping alias of the associated Resource |
float |
getBoost()
Returns, at indexing time, the boost factor as set by setBoost(float). |
String |
getId()
Returns the id of the resource. |
Property[] |
getIdProperties()
Returns the id properties of the resource |
Property |
getIdProperty()
Returns the id property of the resource |
String[] |
getIds()
Returns the id values of the resource. |
Object |
getObject(String name)
Returns the object value of the property with the given name if any exists in the resource, or null. |
Object[] |
getObjects(String name)
Returns an array of values of the proeprty with the given name. |
Property[] |
getProperties()
Returns all the properties for the resource. |
Property[] |
getProperties(String name)
Returns all the properties under the given name. |
Property |
getProperty(String name)
Returns the first property under the name. |
String |
getUID()
Returns the unique id of the resource. |
String |
getValue(String name)
Returns the string value of the property with the given name if any exist in this resource, or null. |
String[] |
getValues(String name)
Returns an array of values of the property specified as the method parameter. |
Resource |
removeProperties(String name)
Removes all the properties under the given name. |
Resource |
removeProperty(String name)
Remove the latest property added under the given name. |
Resource |
setBoost(float boost)
/** Sets a boost factor for hits on any field of this document. |
Resource |
setProperty(Property property)
Sest a property to the resource (removes then adds). |
Resource |
setProperty(String name,
Object value)
Sets a property to the resource (removes then adds) based on resource mapping definitions. |
Resource |
setProperty(String name,
Reader value)
Sets a property to the resource (removes then adds) based on resource mapping definitions. |
| Method Detail |
|---|
String getAlias()
getAlias in interface AliasedObject
String getUID()
throws CompassException
CompassException will be thrown.
CompassExceptionString getId()
String[] getIds()
Property getIdProperty()
Property[] getIdProperties()
String getValue(String name)
name - The name of the property
Object getObject(String name)
If a converter is associated with the property in one of Compass mapping definitions, it will be used to convert the string value to an object value. If there is no converter associated with the property, the string value will be returned.
name - The name of the property
Object[] getObjects(String name)
If a converter is associated with the property in one of Compass mapping definitions, it will be used to convert the string value to an object value. If there is no converter associated with the property, the string value will be returned.
String[] getValues(String name)
null.
name - the name of the property
String[] of property values
Resource addProperty(String name,
Object value)
throws SearchEngineException
name - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineException
Resource addProperty(String name,
Reader value)
throws SearchEngineException
name - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineExceptionResource addProperty(Property property)
property - The properyt to add
Resource setProperty(String name,
Object value)
throws SearchEngineException
name - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineException
Resource setProperty(String name,
Reader value)
throws SearchEngineException
name - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineExceptionResource setProperty(Property property)
property - The properyt to addResource removeProperty(String name)
name - The last property name to removeResource removeProperties(String name)
name - The properties name to removeProperty getProperty(String name)
name - The name of the property
Property[] getProperties(String name)
name - The name of the properties
Property[] getProperties()
float getBoost()
setBoost(float).
Note that once a document is indexed this value is no longer available
from the index. At search time, for retrieved documents, this method always
returns 1. This however does not mean that the boost value set at indexing
time was ignored - it was just combined with other indexing time factors and
stored elsewhere, for better indexing and search performance. (For more
information see the "norm(t,d)" part of the scoring formula in
Similarity.)
Resource setBoost(float boost)
The default value is 1.0.
Values are multiplied into the value of Property.getBoost() of
each properties of the resource. Thus, this method in effect sets a default
boost for the fields of this document.
boost - The boost level for the resourceProperty.setBoost(float)void copy(Resource resource)
resource - The resource to copy from
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||