org.compass.core.lucene
Class LuceneProperty

java.lang.Object
  extended by org.compass.core.lucene.LuceneProperty
All Implemented Interfaces:
Serializable, Property, InternalProperty

public class LuceneProperty
extends Object
implements InternalProperty

An implementation of Property that wraps Lucene Fieldable.

Author:
kimchy
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.compass.core.Property
Property.Index, Property.Store, Property.TermVector
 
Constructor Summary
LuceneProperty(Fieldable field)
           
LuceneProperty(Fieldable field, RepeatableReader reader)
           
 
Method Summary
 byte[] getBinaryValue()
          Returns the binary values of the property.
 float getBoost()
          Returns the boost for the property.
 Fieldable getField()
           
 String getName()
          Returns the name of the property.
 Object getObjectValue()
          Returns the object value of the property.
 ResourcePropertyMapping getPropertyMapping()
           
 RepeatableReader getRepeatableReader()
           
 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 isStoreOffsetWithTermVector()
          Not exported to the users since it is always false when loading the Field from Lucene.
 boolean isStorePositionWithTermVector()
          Not exported to the users since it is always false when loading the Field from Lucene.
 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.
 void setPropertyMapping(ResourcePropertyMapping propertyMapping)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LuceneProperty

public LuceneProperty(Fieldable field)

LuceneProperty

public LuceneProperty(Fieldable field,
                      RepeatableReader reader)
Method Detail

setPropertyMapping

public void setPropertyMapping(ResourcePropertyMapping propertyMapping)

getPropertyMapping

public ResourcePropertyMapping getPropertyMapping()
Specified by:
getPropertyMapping in interface InternalProperty

getRepeatableReader

public RepeatableReader getRepeatableReader()

getField

public Fieldable getField()

getName

public String getName()
Description copied from interface: Property
Returns the name of the property.

Specified by:
getName in interface Property
Returns:
the name of the property

getObjectValue

public Object getObjectValue()
Description copied from interface: Property
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.

Specified by:
getObjectValue in interface Property
Returns:
The converted object value

getStringValue

public String getStringValue()
Description copied from interface: Property
Returns the string value of the proerty.

Specified by:
getStringValue in interface Property
Returns:
the string value

getBinaryValue

public byte[] getBinaryValue()
Description copied from interface: Property
Returns the binary values of the property. Only valid if isBinary is true.

Specified by:
getBinaryValue in interface Property
Returns:
the binary value

getBoost

public float getBoost()
Description copied from interface: Property
Returns the boost for the property.

Specified by:
getBoost in interface Property
Returns:
the boost value

setBoost

public void setBoost(float boost)
Description copied from interface: Property
Sets the boost level for the property. The boost value can be specified in the mapping file to influence the order of search results.

Specified by:
setBoost in interface Property

isIndexed

public boolean isIndexed()
Description copied from interface: Property
True iff the value of the field is to be indexed, so that it may be searched on.

Specified by:
isIndexed in interface Property

isStored

public boolean isStored()
Description copied from interface: Property
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.

Specified by:
isStored in interface Property

isCompressed

public boolean isCompressed()
Description copied from interface: Property
True if the value of the field is stored and compressed within the index

Specified by:
isCompressed in interface Property

isBinary

public boolean isBinary()
Description copied from interface: Property
True iff the value of the filed is stored as binary

Specified by:
isBinary in interface Property

isTokenized

public boolean isTokenized()
Description copied from interface: Property
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.

Specified by:
isTokenized in interface Property

isTermVectorStored

public boolean isTermVectorStored()
Description copied from interface: Property
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.

Specified by:
isTermVectorStored in interface Property

isStoreOffsetWithTermVector

public boolean isStoreOffsetWithTermVector()
Not exported to the users since it is always false when loading the Field from Lucene.


isStorePositionWithTermVector

public boolean isStorePositionWithTermVector()
Not exported to the users since it is always false when loading the Field from Lucene.


isOmitNorms

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

Specified by:
isOmitNorms in interface Property

setOmitNorms

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

Specified by:
setOmitNorms in interface Property

isOmitTf

public boolean isOmitTf()
Description copied from interface: Property
True if tf is omitted for this indexed field

Specified by:
isOmitTf in interface Property

setOmitTf

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

Specified by:
setOmitTf in interface Property

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2004-2009 The Compass Project.