org.compass.core
Interface Property

All Superinterfaces:
Serializable
All Known Subinterfaces:
InternalProperty
All Known Implementing Classes:
LuceneProperty

public interface Property
extends Serializable

The basic Compass meta data holder. A property is a name value pair representing the mapped object attribute and value. Can be used to fetch meta data values from a resource in an abstract way.

As an example:

 resource.getProperty("authorName").getStringValue();
 

Note that there are internal properties (that compass uses for the marshlling of objects) and meta data properties.

Author:
kimchy

Nested Class Summary
static class Property.Index
          Specifies whether and how a meta-data property should be indexed.
static class Property.Store
          Specifies whether and how a meta-data property will be stored.
static class Property.TermVector
          Specifies whether and how a meta-data property should have term vectors.
 
Method Summary
 byte[] getBinaryValue()
          Returns the binary values of the property.
 float getBoost()
          Returns the boost for the property.
 String getName()
          Returns the name of the property.
 Object getObjectValue()
          Returns the object value of the property.
 String getStringValue()
          Returns the string value of the proerty.
 boolean isBinary()
          True iff the value of the filed is stored as binary
 boolean isCompressed()
          True if the value of the field is stored and compressed within the index
 boolean isIndexed()
          True iff the value of the field is to be indexed, so that it may be searched on.
 boolean isOmitNorms()
          Expert: If set, omit normalization factors associated with this indexed field.
 boolean isOmitTf()
          True if tf is omitted for this indexed field
 boolean isStored()
          True iff the value of the field is to be stored in the index for return with search hits.
 boolean isTermVectorStored()
          True iff the term or terms used to index this field are stored as a term vector, available from TODO.
 boolean isTokenized()
          True iff the value of the field should be tokenized as text prior to indexing.
 void setBoost(float boost)
          Sets the boost level for the property.
 void setOmitNorms(boolean omitNorms)
          Expert: If set, omit normalization factors associated with this indexed field.
 void setOmitTf(boolean omitTf)
          Expert: If set, omit tf from postings of this indexed field.
 

Method Detail

getName

String getName()
Returns the name of the property.

Returns:
the name of the property

getStringValue

String getStringValue()
Returns the string value of the proerty.

Returns:
the string value

getObjectValue

Object getObjectValue()
Returns the object value of the property. 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.

Returns:
The converted object value

getBinaryValue

byte[] getBinaryValue()
Returns the binary values of the property. Only valid if isBinary is true.

Returns:
the binary value

getBoost

float getBoost()
Returns the boost for the property.

Returns:
the boost value

setBoost

void setBoost(float boost)
Sets the boost level for the property. The boost value can be specified in the mapping file to influence the order of search results.


isIndexed

boolean isIndexed()
True iff the value of the field is to be indexed, so that it may be searched on.


isStored

boolean isStored()
True iff the value of the field is to be stored in the index for return with search hits. It is an error for this to be true if a field is Reader-valued.


isCompressed

boolean isCompressed()
True if the value of the field is stored and compressed within the index


isTokenized

boolean isTokenized()
True iff the value of the field should be tokenized as text prior to indexing. Un-tokenized fields are indexed as a single word and may not be Reader-valued.


isTermVectorStored

boolean isTermVectorStored()
True iff the term or terms used to index this field are stored as a term vector, available from TODO. These methods do not provide access to the original content of the field, only to terms used to index it. If the original content must be preserved, use the stored attribute instead.


isBinary

boolean isBinary()
True iff the value of the filed is stored as binary


isOmitNorms

boolean isOmitNorms()
Expert: If set, omit normalization factors associated with this indexed field. This effectively disables indexing boosts and length normalization for this field.


setOmitNorms

void setOmitNorms(boolean omitNorms)
Expert: If set, omit normalization factors associated with this indexed field. This effectively disables indexing boosts and length normalization for this field.


isOmitTf

boolean isOmitTf()
True if tf is omitted for this indexed field


setOmitTf

void setOmitTf(boolean omitTf)
Expert: If set, omit tf from postings of this indexed field.



Copyright (c) 2004-2009 The Compass Project.