|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.lucene.LuceneMultiResource
public class LuceneMultiResource
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
LuceneMultiResource(String alias,
LuceneSearchEngineFactory searchEngineFactory)
|
|
| 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 |
addResource()
Adds another Resource, and moves the current resource to the newly created one. |
void |
addUID()
Sets the UID for the resource based on the current ids existing withing the resource and the resource mapping associated with it. |
void |
clear()
Clears all the saves resources. |
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
void |
copy(Resource resource)
Copies the content of the give Resource into the current one |
Resource |
currentResource()
Returns the curren Resource. |
Set<Map.Entry<String,Property[]>> |
entrySet()
|
Property[] |
get(Object key)
|
String |
getAlias()
Returns the mapping alias of the associated Resource |
float |
getBoost()
Returns, at indexing time, the boost factor as set by Resource.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 |
getSubIndex()
Returns the sub index this resource is associated with. |
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. |
boolean |
isEmpty()
|
Set<String> |
keySet()
|
Property[] |
put(String key,
Property[] value)
|
void |
putAll(Map<? extends String,? extends Property[]> t)
|
Property[] |
remove(Object key)
|
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 |
resource(int i)
Returns the Resource at the given postion. |
ResourceKey |
resourceKey()
|
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. |
int |
size()
Returns the number of Resources. |
String |
toString()
|
Collection<Property[]> |
values()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public LuceneMultiResource(String alias,
LuceneSearchEngineFactory searchEngineFactory)
| Method Detail |
|---|
public int size()
MultiResourceResources.
size in interface Map<String,Property[]>size in interface MultiResourcepublic Resource currentResource()
MultiResourceResource.
currentResource in interface MultiResourcepublic ResourceKey resourceKey()
resourceKey in interface InternalResourcepublic String getSubIndex()
InternalResource
getSubIndex in interface InternalResourcepublic void addResource()
MultiResourceResource, and moves the current resource to the newly created one.
addResource in interface MultiResourcepublic Resource resource(int i)
MultiResourceResource at the given postion.
resource in interface MultiResourcepublic void clear()
MultiResource
clear in interface Map<String,Property[]>clear in interface MultiResourcepublic String getAlias()
Resource
getAlias in interface ResourcegetAlias in interface AliasedObjectpublic String getUID()
ResourceCompassException will be thrown.
getUID in interface Resourcepublic String getId()
Resource
getId in interface Resourcepublic String[] getIds()
Resource
getIds in interface Resourcepublic Property getIdProperty()
Resource
getIdProperty in interface Resourcepublic Property[] getIdProperties()
Resource
getIdProperties in interface Resourcepublic String getValue(String name)
Resource
getValue in interface Resourcename - The name of the property
public Object getObject(String name)
ResourceIf 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.
getObject in interface Resourcename - The name of the property
public Object[] getObjects(String name)
ResourceIf 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.
getObjects in interface Resourcepublic String[] getValues(String name)
Resourcenull.
getValues in interface Resourcename - the name of the property
String[] of property values
public Resource addProperty(String name,
Object value)
throws SearchEngineException
Resource
addProperty in interface Resourcename - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineException
public Resource addProperty(String name,
Reader value)
throws SearchEngineException
Resource
addProperty in interface Resourcename - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineExceptionpublic Resource addProperty(Property property)
Resource
addProperty in interface Resourceproperty - The properyt to add
public Resource setProperty(String name,
Object value)
throws SearchEngineException
Resource
setProperty in interface Resourcename - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineException
public Resource setProperty(String name,
Reader value)
throws SearchEngineException
Resource
setProperty in interface Resourcename - the name of the propertyvalue - the value to be set (will be converted to a string).
SearchEngineExceptionpublic Resource setProperty(Property property)
Resource
setProperty in interface Resourceproperty - The properyt to addpublic Resource removeProperty(String name)
Resource
removeProperty in interface Resourcename - The last property name to removepublic Resource removeProperties(String name)
Resource
removeProperties in interface Resourcename - The properties name to removepublic Property getProperty(String name)
Resource
getProperty in interface Resourcename - The name of the property
public Property[] getProperties(String name)
Resource
getProperties in interface Resourcename - The name of the properties
public Property[] getProperties()
Resource
getProperties in interface Resourcepublic float getBoost()
ResourceResource.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.)
getBoost in interface Resourcepublic Resource setBoost(float boost)
ResourceThe 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.
setBoost in interface Resourceboost - The boost level for the resourceProperty.setBoost(float)public void addUID()
InternalResource
addUID in interface InternalResourcepublic void copy(Resource resource)
Resource
copy in interface Resourceresource - The resource to copy frompublic String toString()
toString in class Objectpublic boolean isEmpty()
isEmpty in interface Map<String,Property[]>public boolean containsKey(Object key)
containsKey in interface Map<String,Property[]>public boolean containsValue(Object value)
containsValue in interface Map<String,Property[]>public Collection<Property[]> values()
values in interface Map<String,Property[]>public void putAll(Map<? extends String,? extends Property[]> t)
putAll in interface Map<String,Property[]>public Set<Map.Entry<String,Property[]>> entrySet()
entrySet in interface Map<String,Property[]>public Set<String> keySet()
keySet in interface Map<String,Property[]>public Property[] get(Object key)
get in interface Map<String,Property[]>public Property[] remove(Object key)
remove in interface Map<String,Property[]>
public Property[] put(String key,
Property[] value)
put in interface Map<String,Property[]>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||