|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.mapping.osem.builder.SearchableMappingBuilder
public class SearchableMappingBuilder
Marks a class as searchable. A searchable class is assoiated with an alias, and allows to perform full text search on it's mapped properties/fields.
The searchable class is associated with an alias, which can be used to reference the class when performing search operations, or for other mappings to extend it. By default, teh alias name will be the class short name.
Note, a root searchable must be associated with at least one SearchableIdMappingBuilder.
By default, the searchable class is defined as a root class. A root class is
a top level searchable class. A non root class can be used to define mappings
definitions for SearchableComponentMappingBuilder, and it is preferable that classes
that are only used as component mapping definitions, will be defined with root(boolean)
set to false.
A class mapping has it's own fully functional index, unless using the
subIndex(String) to join several searchable classes into the same
index (when joining several searchalbe classes into the same index,
the search will be much faster, but updates perform locks on the sub index
level, so it might slow it down). More fine grained control can be acheived
using subIndex(org.compass.core.engine.subindex.SubIndexHash) allowing
to parition the same class into several sub indexes using
ModuloSubIndexHash definition.
A searchable class creates an internal "all" meta-data, which holds
searchable information of all the class searchable content. Controlling
the "all" property using the SearchableAllMappingBuilder and setting it
using all(SearchableAllMappingBuilder).
The seachable class can have a specialized analyzer (different from the
default one) associated with it using analyzer(String). Note, that this
will associate the class statically with an analyzer. Dynamically associating
the class with an analyzer, the SearchableAnalyzerMappingBuilder can be
used to annotated the dynamic value for the analyzer to use.
The poly(boolean) can be used to mapped polymprphic inheritance tree. This is the less
prefable way to map an inhertiance tree, since the fact that a searchable class extend other
searchable classes using the extendsAliases(String[]) mapping.
OSEM.searchable(Class)| Constructor Summary | |
|---|---|
SearchableMappingBuilder(Class clazz)
Constructs a new class mapping builder for the specified class. |
|
| Method Summary | |
|---|---|
SearchableMappingBuilder |
add(SearchableAnalyzerMappingBuilder builder)
Adds an analyzer proeprty mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchableBoostMappingBuilder builder)
Adds a boost property mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchableCascadeMappingBuilder builder)
Addsa cascade mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchableComponentMappingBuilder builder)
Adds a component mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchableConstantMappingBuilder builder)
Adds a constant mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchableDynamicMetaDataMappingBuilder builder)
Adds a dynamic meta data mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchableDynamicPropertyMappingBuilder builder)
Adds a dynamic property mapping to searchable class. |
SearchableMappingBuilder |
add(SearchableIdComponentMappingBuilder builder)
Adds an id component mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchableIdMappingBuilder builder)
Adds an id property mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchableParentMappingBuilder builder)
Adds parent mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchablePropertyMappingBuilder builder)
Adds a proeprty mapping to the searchable class. |
SearchableMappingBuilder |
add(SearchableReferenceMappingBuilder builder)
Adds a reference mapping to the searchable class. |
SearchableMappingBuilder |
alias(String alias)
Sets the alias of the searchable class. |
SearchableMappingBuilder |
all(SearchableAllMappingBuilder builder)
Allows to set the "all" mapping definition. |
SearchableMappingBuilder |
analyzer(String analyzer)
The name of the analyzer that will be used to analyze ANALYZED properties. |
SearchableMappingBuilder |
boost(float boost)
Sets the boost value for the class. |
SearchableMappingBuilder |
extendsAliases(String... extendedAliases)
Sets the list of other clas mappings that this mapping will extend and inherit internal mappings from. |
SearchableMappingBuilder |
filterDuplicatesDuringUnmarshalling(boolean filterDuplicatesDuringUnamrshalling)
Should the searchable class filter out duplicates during unmarshalling. |
ResourceMapping |
getMapping()
Returns the mapping. |
SearchableMappingBuilder |
managedId(ManagedId managedId)
Controls the managed id value for all the mapped properties that have no explicit setting of the managed id (also default to NA). |
SearchableMappingBuilder |
mappingConverter(Converter converter)
Sets the mapping converter that will be used to convert the class. |
SearchableMappingBuilder |
mappingConverter(String converter)
Sets the mapping converter lookup name that will be used to convert the class. |
SearchableMappingBuilder |
poly(boolean poly)
Used to mapped polymprphic inheritance tree. |
SearchableMappingBuilder |
polyClass(Class polyClass)
In cases where poly is set to true, allows to set the class that will
be used to instantiate in all inheritance tree cases. |
SearchableMappingBuilder |
root(boolean root)
Sets if the class is a root mapping or not. |
SearchableMappingBuilder |
spellCheck(SpellCheck spellCheck)
Sets the spell check mode that will be used for this class mapping (and for all the internal mappings that do not explicitly set their own spell check mode). |
SearchableMappingBuilder |
subIndex(String subIndex)
Sets a sub index that will be used for this resource. |
SearchableMappingBuilder |
subIndex(SubIndexHash subIndexHash)
Sets a custom sub index hashing strategy for the resource mapping. |
SearchableMappingBuilder |
supportUnmarshall(boolean supportUnmarshall)
Controls if the searchable class will support unamrsahlling or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SearchableMappingBuilder(Class clazz)
| Method Detail |
|---|
public ResourceMapping getMapping()
getMapping in interface ResourceMappingProviderpublic SearchableMappingBuilder alias(String alias)
add.
public SearchableMappingBuilder root(boolean root)
true.
public SearchableMappingBuilder supportUnmarshall(boolean supportUnmarshall)
When supporting unmarshalling, Compass might store additional properties in the resource that
represents this searchable class (for example, to store the size of a collection). Note, when
support unamrshalling is set to false, then one can still use the Resource
loaded from the index.
Defaults to the a globabl setting CompassEnvironment.Osem.SUPPORT_UNMARSHALL
which in turn defaults to true.
public SearchableMappingBuilder filterDuplicatesDuringUnmarshalling(boolean filterDuplicatesDuringUnamrshalling)
CompassEnvironment.Osem.FILTER_DUPLICATES.
public SearchableMappingBuilder poly(boolean poly)
extendsAliases(String[]).
If poly is set to true, the actual class implementation will be persisted
to the index, later be used to instantiate it when un-marhsalling. If a specific class
need to be used to instantiate all classes, use the {polyClass(Class) to set it.
public SearchableMappingBuilder polyClass(Class polyClass)
true, allows to set the class that will
be used to instantiate in all inheritance tree cases.
If not set, the actual class will be saved to the index, later be used to instantiate it when un-marhsalling
public SearchableMappingBuilder managedId(ManagedId managedId)
ManagedId.NO_STORE.
public SearchableMappingBuilder subIndex(String subIndex)
ConstantSubIndexHash.
public SearchableMappingBuilder subIndex(SubIndexHash subIndexHash)
public SearchableMappingBuilder extendsAliases(String... extendedAliases)
public SearchableMappingBuilder spellCheck(SpellCheck spellCheck)
public SearchableMappingBuilder analyzer(String analyzer)
default
analyzer.
Note, that when using the class-analyzer mapping (a child mapping of class mapping) (for a class property value that controls the analyzer), the analyzer attribute will have no effects.
public SearchableMappingBuilder boost(float boost)
public SearchableMappingBuilder all(SearchableAllMappingBuilder builder)
public SearchableMappingBuilder mappingConverter(String converter)
ClassMappingConverter.
public SearchableMappingBuilder mappingConverter(Converter converter)
ClassMappingConverter.
public SearchableMappingBuilder add(SearchableIdMappingBuilder builder)
public SearchableMappingBuilder add(SearchablePropertyMappingBuilder builder)
public SearchableMappingBuilder add(SearchableDynamicPropertyMappingBuilder builder)
public SearchableMappingBuilder add(SearchableAnalyzerMappingBuilder builder)
public SearchableMappingBuilder add(SearchableBoostMappingBuilder builder)
public SearchableMappingBuilder add(SearchableComponentMappingBuilder builder)
public SearchableMappingBuilder add(SearchableIdComponentMappingBuilder builder)
public SearchableMappingBuilder add(SearchableReferenceMappingBuilder builder)
public SearchableMappingBuilder add(SearchableConstantMappingBuilder builder)
public SearchableMappingBuilder add(SearchableDynamicMetaDataMappingBuilder builder)
public SearchableMappingBuilder add(SearchableCascadeMappingBuilder builder)
public SearchableMappingBuilder add(SearchableParentMappingBuilder builder)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||